What Python keyword is used to display text on the screen?
print()
What is the difference between an integer and a float?
Integers are whole numbers; floats have decimals
Which keyword is used to check a condition in Python?
if
Which loop is best when you know how many times something should repeat?
For loop
What will the following code print?
Hello, World!
What symbol is used to combine (concatenate) two strings?
+
What will this code print?
Yes
What will this code print?
Hi
Hi
Hi
Write the corrected version of this line of code:
print("Hello")
What will this code print?
Hello Alex
What keyword allows you to check another condition if the first one is false?
elif
Which loop repeats as long as a condition is true?
While loop
How do you print the value of a variable named score?
print(score)
Why does this code cause an error?
We can't concatenate (combine) strings and integers-- only STRINGS can be combined with other strings.
What will this code print?
B
What will this code print?
0
1
2
What will this code output?
It will give an error because we can only combine strings with other strings and numbers with other numbers.
age = 12
print("Age: " + age)
How can you fix the code above so it works correctly?
print("Age: " + str(age))
Elif and else statements can come before an if statement.
True/False
False
What happens if a while loop condition never becomes false?
It becomes an infinite loop