Quiz: Loops and Recursion
Test your knowledge of loops and recursion with this quiz.
1
Have a look at the for
loop below:
string_list = ["Anakin", "Luke", "Rey", "Leia", "Vader"]
for s in string_list:
if len(s) < 5:
print(len(s))
What will be the output on the terminal at the end of the loop?
A)
Luke
Rey
Leia
Vader
B)
4
3
4
5
C)
Luke
Rey
Leia
D)
4
3
4
Question 1 of 40 attempted
Get hands-on with 1200+ tech skills courses.