top of page
A Big Calculator
Other Operations
Comments
Checkpoint #1
Variables
Checkpoint #2
Summary
Other Operations
Just like you learned in math class, all of the common mathematical operators work exactly the same in Python as they do on a trusty calculator:
Addition
Subtraction
Multiplication
Division
+
-
*
/
x + y
x - y
x * y
x / y
Try out the following commands in the terminal below. Can the computer get the correct answers?
1 print(17 + 34)
2 print(103 - 87)
3 print(14 * 4)
4 print(123 / 3)
5 print(1 + (2 * 3) / 6)
bottom of page