JavaScript isn't enabled in your browser, so this file can't be opened. Enable and reload.
Python Loops and Conditional Statements
Sign in to Google
to save your progress.
Learn more
* Indicates required question
Email
*
Your email
What statements are part of a conditional statement?
5 points
if
for
elif
else
else if
Which of the following are valid types of loops in Python?
*
4 points
since
for
while
until
Required
Which of the following is the correct syntax for a conditional statement in Python3?
*
4 points
if x > 5: then print("x is greater than 5")
if x > 5 print "x is greater than 5"
if x > 5: print("x is greater than 5")
if (x > 5) { print "x is greater than 5"; }
What is the purpose of the
else
block in a Python conditional statement?
*
4 points
To check for additional conditions when the if condition is false
To execute code only when the if condition is true
To execute code if all previous if and elif conditions are false
To repeat the if block if its condition is false
Which of the following can cause an infinite loop in Python?
*
5 points
Forgetting to increment a counter inside a for loop
Forgetting to increment a counter inside a while loop
Using break inside a while loop
Using a while loop with a condition that never becomes False
Using a for loop with range(0, 10)
Required
Which of the following is the correct syntax for a
for
loop in Python?
*
3 points
for (i = 0; i < 10; i++): print(i)
for i in range(10): print(i)
for i to 10: print(i)
for i from 0 to 10: print(i)
Send me a copy of my responses.
Submit
Clear form
reCAPTCHA
Privacy
Terms
This content is neither created nor endorsed by Google. -
Terms of Service
-
Privacy Policy
Does this form look suspicious?
Report
Forms
Help and feedback
Contact form owner
Help Forms improve
Report