lesson 4
lesson 4
Numbers + Math
Numbers + Math
Now that you've learned variables, it's time to use them with numbers!
Python can do maths for you:
apples = 5
oranges = 3
total = apples + oranges
print(total)
The output will be: 8
You can use:
+ addition
- subtraction
* multiplication
/ division
Change the numbers and see what happens.
Create two variables called number1 and number2, add them together, and store the answer in a variable called total.
Then print total.
number1 = 10
number2 = 5
total = number1 + number2
print(total)
Next - Coming soon! Continue building your Python skills with the next lesson in the course.