This common data type stores letters, numbers, and symbols.
What is a string?
Data stored as a string is surrounded by these.
What are quotes or apostrophes?
The result of:
print(True and False)
False
The result of:
my_list = [5,4,3,2,1]
print(my_list.append(7))
[5,4,3,2,1,7]
The result of 10 / 5
What is 2.0?
This data type stores decimal numbers.
What is a float?
The result of:
print(10 - 4 * 2)
2
The result of [3,4] == [4,3]
False
The result of 10//2.
5
String
This statement allows for conditional execution of a line of code or group of lines based on the value of a conditional expression.
What is an 'if' statement?
The result of:
print(10%2)
0
The result of print(20//6)
3
To raise the number 5 to the power of 8, you must use the power operator. This/These symbol(s) denote the power operator.
What are two asterisks (**) ?
The result of:
print("1" + "13")
113
The result of:
c = 2 ** 3 + 4 * 2
print(c)
16
The result of print("12"*3)
121212
To determine the data type of a variable, you would use this function.
What is type()?
The following Python code loops forever. What is it missing?
n = 10
while n<100:
print n
What is a increment statement?
The result of:
print(2 * 3 ** 2 * 2)
4 Data Structure types in Python
Lists, Sets, Tuples, Dictionaries