Print Statements
Strings/Numbers
If/Elif/Else
For and While Loops
100

What Python keyword is used to display text on the screen?

print()

100

What is the difference between an integer and a float?

Integers are whole numbers; floats have decimals

100

Which keyword is used to check a condition in Python?

if

100

Which loop is best when you know how many times something should repeat?

For loop

200

What will the following code print?


print("Hello, World!")


Hello, World!

200

What symbol is used to combine (concatenate) two strings?

+

200

What will this code print?


if 10 > 5:    
       print("Yes")
else:    
       print("No")


Yes

200

What will this code print?


for i in range(3):    
      print("Hi")


Hi

Hi

Hi

300

Write the corrected version of this line of code:


print Hello


print("Hello")

300

What will this code print?


name = "Alex"
print("Hello " + name)


Hello Alex

300

What keyword allows you to check another condition if the first one is false?

elif

300

Which loop repeats as long as a condition is true?

While loop

400

How do you print the value of a variable named score?

print(score)

400

Why does this code cause an error?


age = 12
print("Age: " + age)


We can't concatenate (combine) strings and integers-- only STRINGS can be combined with other strings.

400

What will this code print?


score = 85
if score >= 90:    
        print("A")
elif score >= 80:    
         print("B")
else:    
         print("C")


  B

400

What will this code print?


count = 0
while count < 3:    
         print(count)    
         count += 1


0

1

2

500

What will this code output?


print("Score:" + 10)


It will give an error because we can only combine strings with other strings and numbers with other numbers.

500

age = 12

print("Age: " + age)


How can you fix the code above so it works correctly?

print("Age: " + str(age))

500

Elif and else statements can come before an if statement.

True/False

False

500

What happens if a while loop condition never becomes false?

It becomes an infinite loop

M
e
n
u