num1 = 5
num2 = 7.5
word = "apple"
isOpen = True
print(type(num1))
print(type(num2))
print(type(word))
print(type(isOpen))
Initialize a variable named num1 with the value 5.
Initialize a variable named num2 with the value 7.5.
Initialize a variable named word with the value "apple".
Initialize a variable named isOpen with the value True.
Display the type of data stored in num1 using a print() statement and the type() method.
Display the type of data stored in num2 using a print() statement and the type() method.
Display the type of data stored in word print() statement and the type() method.
Display the type of data stored in isOpen print() statement and the type() method.
The following example demonstrates the expected program output.
<class 'int'>
<class 'float'>
<class 'str'>
<class 'bool'>
num2 = 7.5
word = "apple"
isOpen = True
print(type(num1))
print(type(num2))
print(type(word))
print(type(isOpen))
Initialize a variable named num1 with the value 10.
Initialize a variable named num2 with the value 20.
Initialize a variable named num3 with the value 5.5.
Initialize a variable named num4 with the value of num1 plus num2.
Initialize a variable named num5 with the value of num1 multiplied by num3.
Initialize a variable named num6 with the value of num2 modulus num1.
Initialize a variable named num7 with the value of num1 minus num2.
Initialize a variable named num8 with the value of num2 divided by num3 (floating-point division).
Initialize a variable named num9 with the value of num2 divided by num3 (dropping the fractional result).
Display the value of num4 with print().
Display the value of num5 with print().
Display the value of num6 with print().
Display the value of num7 with print().
Display the value of num8 with print().
Display the value of num9 with print().
The following example demonstrates the expected program output.
num2 = 20
num3 = 5.5
num4 = num1 + num2
num5 = num1 * num3
num6 = num2 % num1
num7 = num1 - num2
num8 = num2 / num3
num9 = num2 // num3
print(num4)
print(num5)
print(num6)
print(num7)
print(num8)
print(num9)
Add parentheses so the addition operation happens firs
Add parentheses so the subtraction operation happens next
The following example demonstrates the expected program output.
30.0
num2 = 20
num3 = 5.5
result = (num1 + num2) * num3 - num1
print(result)
```python
# Step 1: Initialize variables
num1 = 5
num2 = 7.5
word = "apple"
isOpen = True
# Step 2: Display the type of data stored in num1
print(type(num1))
# Step 3: Display the type of data stored in num2
print(type(num2))
# Step 4: Display the type of data stored in word
print(type(word))
# Step 5: Display the type of data stored in isOpen
print(type(isOpen))
```
When you run this program, it will produce the following output:
```
<class 'int'>
<class 'float'>
<class 'str'>
<class 'bool'>
```
Each step is outlined in the comments to guide you through the process.