Math Magic
Hoppy needs to calculate how much food he has. Python is a very powerful calculator.
Operators
+: Plus-: Minus*: Multiply (Star)/: Divide (Slash)
Your Mission
1
Calculate
Calculate 10 times 5, and store it in a variable named total.
2
Print
Print the total.
Suggested SolutionClick to expandClick to collapse
total = 10 * 5 print(total)
Advanced TipsWant more? Click to expandClick to collapse
Python follows standard math rules (PEMDAS). Multiplication * and division / happen before addition + and subtraction -.
print(2 + 3 * 4) # Result: 14 (not 20)
pymain.py
Loading...
Terminal
Terminal
Ready to run...