Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Addition | Arithmetic operations
Learn Python from Scratch
course content

Зміст курсу

Learn Python from Scratch

Learn Python from Scratch

1. The basics
2. Arithmetic operations
3. Common data types
4. Conditional statements
5. Other data types
6. Loops
7. Functions

Addition

Addition in Python is easy - just use "+" sign. You can add numbers or variables (or mix of numbers and variables).

1234
a = 1 b = 2 c = a + b print(c)
copy

Sometimes people use alternative operator: "+=" (it is typically used for brevity). Please see example below (this basically means "increase variable on the left hand side by 1"):

123
x = 100 x+=1 print(x)
copy

Завдання

Add line to print the sum of 20 and 22.

Завдання

Add line to print the sum of 20 and 22.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 2. Розділ 1
toggle bottom row

Addition

Addition in Python is easy - just use "+" sign. You can add numbers or variables (or mix of numbers and variables).

1234
a = 1 b = 2 c = a + b print(c)
copy

Sometimes people use alternative operator: "+=" (it is typically used for brevity). Please see example below (this basically means "increase variable on the left hand side by 1"):

123
x = 100 x+=1 print(x)
copy

Завдання

Add line to print the sum of 20 and 22.

Завдання

Add line to print the sum of 20 and 22.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 2. Розділ 1
toggle bottom row

Addition

Addition in Python is easy - just use "+" sign. You can add numbers or variables (or mix of numbers and variables).

1234
a = 1 b = 2 c = a + b print(c)
copy

Sometimes people use alternative operator: "+=" (it is typically used for brevity). Please see example below (this basically means "increase variable on the left hand side by 1"):

123
x = 100 x+=1 print(x)
copy

Завдання

Add line to print the sum of 20 and 22.

Завдання

Add line to print the sum of 20 and 22.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Addition in Python is easy - just use "+" sign. You can add numbers or variables (or mix of numbers and variables).

1234
a = 1 b = 2 c = a + b print(c)
copy

Sometimes people use alternative operator: "+=" (it is typically used for brevity). Please see example below (this basically means "increase variable on the left hand side by 1"):

123
x = 100 x+=1 print(x)
copy

Завдання

Add line to print the sum of 20 and 22.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Секція 2. Розділ 1
Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
We're sorry to hear that something went wrong. What happened?
some-alt