Addition
Addition in Python is easy - just use "+" sign. You can add numbers or variables (or mix of numbers and variables).
1234a = 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"):
123x = 100 x+=1 print(x)
Swipe to start coding
Add line to print the sum of 20 and 22.
Løsning
Takk for tilbakemeldingene dine!
single
Spør AI
Spør AI
Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår
Awesome!
Completion rate improved to 2.33Awesome!
Completion rate improved to 2.33
Addition
Addition in Python is easy - just use "+" sign. You can add numbers or variables (or mix of numbers and variables).
1234a = 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"):
123x = 100 x+=1 print(x)
Swipe to start coding
Add line to print the sum of 20 and 22.
Løsning
Takk for tilbakemeldingene dine!
single
Awesome!
Completion rate improved to 2.33
Addition
Sveip for å vise menyen
Addition in Python is easy - just use "+" sign. You can add numbers or variables (or mix of numbers and variables).
1234a = 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"):
123x = 100 x+=1 print(x)
Swipe to start coding
Add line to print the sum of 20 and 22.
Løsning
Takk for tilbakemeldingene dine!