Instruction
Great! It's time to wrap things up.
print(x)showsxin the console output.print(x, y, ...)will showx,y, and any number of additional arguments, all separated with single spaces.-
To assign the value 3 to a variable named
number, use:number = 3
Among others, there are three basic data types:
- integer (
int), - float (
float) – floating point numbers with a dot (.), - string (
string) – text values in apostrophes.
- integer (
Mathematical operators:
-
+,-,*,/– addition, subtraction, multiplication, division. -
//– floor division (i.e. round down to nearest integer). -
%–a%bfinds the remainder from the division ofabyb. -
To accept user input, use:
amount = input('What is the amount?') - To convert between data types, use
str(x),int(x)andfloat(x).
-
Alright, how about a challenge now?
Exercise
Click the to begin the quiz.



