Course Content
Learn Python from Scratch
Learn Python from Scratch
Addition
Addition in Python is easy - just use "+" sign. You can add numbers or variables (or mix of numbers and variables).
a = 1 b = 2 c = a + b print(c)
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"):
x = 100 x+=1 print(x)
Task
Add line to print the sum of 20 and 22.
Task
Add line to print the sum of 20 and 22.
Everything was clear?
Addition
Addition in Python is easy - just use "+" sign. You can add numbers or variables (or mix of numbers and variables).
a = 1 b = 2 c = a + b print(c)
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"):
x = 100 x+=1 print(x)
Task
Add line to print the sum of 20 and 22.
Task
Add line to print the sum of 20 and 22.
Everything was clear?
Addition
Addition in Python is easy - just use "+" sign. You can add numbers or variables (or mix of numbers and variables).
a = 1 b = 2 c = a + b print(c)
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"):
x = 100 x+=1 print(x)
Task
Add line to print the sum of 20 and 22.
Task
Add line to print the sum of 20 and 22.
Everything was clear?
Addition in Python is easy - just use "+" sign. You can add numbers or variables (or mix of numbers and variables).
a = 1 b = 2 c = a + b print(c)
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"):
x = 100 x+=1 print(x)
Task
Add line to print the sum of 20 and 22.