<
RHD
/>
Home
Blog
Quiz
Resources
About
Contact
// guest
▾
Login
Request Account
[ light ]
// Control Flow
Control Flow Quiz
// question 1 of 10
What is printed? for i in range(5): if i == 2: break print(i)?
0 1 2 3 4
0 1
2
// question 2 of 10
What is printed? for i in range(5): if i==3: break else: print(i)?
3
0 1 2
0 1 2 3 4
// question 3 of 10
What is printed? x=0 while x<5: x+=2 print(x)?
0 2 4
2 4 6
1 3 5
// question 4 of 10
What does elif do?
Creates loops
Checks another condition
Prints values
// question 5 of 10
What is printed? if True: print(""A"")?
Error
Nothing
A
// question 6 of 10
What is the result of 4 != 5?
False
4
True
// question 7 of 10
What is the last value in range(5)?
3
5
4
// question 8 of 10
What is printed? for i in range(2): for j in range(2): print(""X"")?
X printed 4 times
X printed 8 times
X printed 2 times
// question 9 of 10
What is printed? for i in range(3): print(""A""+str(i))?
A0 A1 A2
A1 A2 A3
A
// question 10 of 10
What does pass do?
Does nothing
Stops program
Repeats loop
Submit Answers →