- Enter Python interactive mode
python3
- Create three variables
>>> a = 4
>>> b = 5
>>> c = 6
- Print the values of the variables you just created
>>> (4, 5, 6)
Notice that you can print more than one variable at a time.
- Perform some calculations using addition and subtraction
>>> a + b + c
>>> a + b - c
>>> b - c - a
- Perform some calculations using the division and remainder operators
>>> c / a
>>> c // a
>>> c % a
Notice the difference between the two different types of division.
- Perform some operations using the exponent operator
>>> a ** 2
>>> a ** 3
>>> a ** 4
- Perform some calculations involving operator precedence
>>> a + b * c
>>> (a + b) * c
>>> a + b / c
>>> a + b // c
>>> a + b % c
>>> (a + b) / c
>>> (a + b) // c
>>> (a + b) % c
- Quit interactive mode
Control D