Select Page

ABIOLA RASP – Raspberries for African School Projects

Wie können wir helfen?

< Alle Themen
Print

Python – Number variables

no-158 au-03

Number Variables

Number variables store numeric values.

Please see the article “Python – First Program” how to open Thonny Python IDE and how to save your work.

  1. Number variable: yourAge stores number 10.
  2. Number variable: myAge stores number 8
  3. Number variable: ourTotalAge stores the sum of yourAge and myAge
  4. Here is the python code:

yourAge = 10
myAge = 8 

ourTotalAge = yourAge + myAge 

print(ourTotalAge)

5 Click Run button
6. Here is the result. (10 + 8 = 18)

You can also use other operators.
Subtraction: (x – y)
Multiplication: (x * y)
Division: (x / y)

See the articles in RASP Library about Python

Inhaltsverzeichnis