The data type that represents whole numbers
Integer
The symbol used for variable assignment
=
Evaluate the expression: 11 + 3
14
x = 2
y = 5 + x
What value does y store?
7
"abc123" is an example of this data type
String
The correct way to declare a python variable called x storing a value of 5
Evaluate the expression: "4" + "ever"
"4ever"
y = 12
x = 3
y = y * x
What does y store?
36
Data type that can have only one of two possible values.
Boolean
The reason y and Y would not be considered the same variable name
Variable names are case sensitive
Evaluate the expression: "1" + "1"
"11"
a = 17
b = 5
a = a + 1
b = a + 7
What do a and b store?
18 and 25
Write a line of code that casts the integer 5 into the string "5"
str(5)
1. x = 5
2. x = 3
What happens to the 5 when line 2 of the code executes?
It is thrown away.
Evaluate the expression: 5*2+1
11
zap = 7 * 3
zip = int(zap/5)
What does zip store?
4
Write a single line of code that accomplishes both of the following:
-Asks the user to input a number
-Converts that number from string to integer
int(input("Enter a number: ")
(or similar)
Variable names can contain these kinds of characters
alphanumeric and underscore (_)
num = int((3+8)/(5-2))
What value does num store?
3
wow = yay/3
yay = int(wow)
wow = 10/yay
What values do yay and wow store?
13 and 0