Skip to content
OtisamLMS
Computing

Computing · Quick practice · answer shown after each question

Python: selection and iteration

Question 1 of 10

Question 1 of 10

A for loop can iterate over the characters in a string.

Question 2 of 10

Question 2 of 10

Write a program that prints the multiplication table of a number entered by the user, from 1 to 12.

Question 3 of 10

Question 3 of 10

The value of total after total = 1; for i in range(1, 4): total *= i is ___.

Question 4 of 10

Question 4 of 10

elif lets you test another condition when the previous ones are False.

Question 5 of 10

Question 5 of 10

An infinite loop can be caused by

Question 6 of 10

Question 6 of 10

range(1, 10) includes the number 10.

Question 7 of 10

Question 7 of 10

Which condition tests whether age is between 13 and 19 inclusive?

Question 8 of 10

Question 8 of 10

A loop placed inside another loop is called a ___ loop.

Question 9 of 10

Question 9 of 10

Write a program that checks whether a number entered by the user is prime.

Question 10 of 10

Question 10 of 10

A loop inside another loop runs the inner loop

Questions written by OtisamLMS in the style of the WASSCE. They are not WAEC past questions.