Name:     ID: 
 
Email: 

Python Programming - Assessment 2

Multiple Choice
Identify the choice that best completes the statement or answers the question.
 

 1. 

if 5 > 10:
    print("fan")
elif 8 != 9:
    print("glass")
else:
    print("cream")
a.
fan
c.
cream
b.
glass
d.
True
 

 2. 

What does the following code print?

sum = 14

if  sum < 20 :
   print("Under ")
else:
   print("Over  ")
a.
Under
c.
Under
Over
b.
Over
 

 3. 

What would be the starting value for the for loop?

for num in range(25):
    print(num)

a.
25
c.
4
b.
1
d.
0
 

 4. 

Which of the following symbols in Python is used to mean “Not Equal to”?
a.
< >
c.
= =
b.
! =
d.
>=
 

 5. 

What would be the increment value for the for loop?

for num in range(25):
    print(num)

a.
25
c.
4
b.
1
d.
0
 

 6. 

What is the output of the following code?

while 4 = = 4:
       print(“4”)
a.
4 is printed infinitely until the program closes
c.
4 is printed once
b.
Syntax error
d.
4 is printed four times
 



 
         Start Over