Theory

Python can work as a calculator! Use these operators:

+ addition (сложение)
- subtraction (вычитание)
* multiplication (умножение)
/ division (деление)

Examples / Примеры:

result = 5 + 3 # result is 8
result = 10 - 4 # result is 6
result = 3 * 4 # result is 12
result = 15 / 3 # result is 5.0

You can also print calculations directly:

print(2 + 2) # Will display: 4

Exercises in this lesson

4

Rectangle Area

Calculate the area of a rectangle with width = 5 and height = 4. Area = width * height Store the result in 'area' and display it.

Medium Points: 20
Solve in the playground
Next lesson: Strings →