PROY8

Quiz by Yaithd Daniel Olivas Arcos

Our brand new solo games combine with your quiz, on the same screen

Correct quiz answers unlock more play!

19 questions
• Q1

A for loop is used only to print messages.

boolean://false

30s
• Q2

With the for loop, we can execute a set of instructions.

boolean://true

30s
• Q3

What is the name of the variable the for loop used to iterate?

scrambled://indexing variable

30s
• Q4

Imagine that you want to print all the elements of the following list using a for loop:

planets = ["Sun", "Earth", "Jupiter", "Saturn"]

Choose the missing piece of code to achieve this.

print

planets

planet

fruits

300s
• Q5

With the break statement, we can stop the loop before it has looped through all the items.

boolean://true

300s
• Q6

Type in the missing piece of code so the program on the image prints all the elements except banana.

scrambled://continue

300s
• Q7

Imagine that you want to implement a for loop whose indexing variable takes values from 3 to 16. Choose the correct option for the range function.

range(2,17)

range(3,17)

range(3,16)

range(2,16)

300s
• Q8

Imagine that you want to print the following numbers using a for loop:

0, 10, 20, 30, 40, 50, 60, 70, 80, 90 and 100

Choose the correct option for the range function.

range(1, 101, 10)

range(0, 101, 10)

range(0, 100, 10)

range(0, 101, 11)

300s
• Q9

With the else statement, we can run a block of code once the for loop has ended.

boolean://true

300s
• Q10

i +=1 means that the variable must decrease its value by one unit every time the loop iterates over this instruction.

boolean://false

300s
• Q11

​​How many ways does Python have to implement loops?

freetextm://two:2:Two

300s
• Q12

The code in the image prints all the numbers starting from 1 to 6.

boolean://false

300s
• Q13

Type in all the numbers obtained using this program. Use a comma to separate each number and don't include spaces.

freetext://1,2,3

300s
• Q14

Imagine that you want to print all the elements of the following list using a while loop:

planets = ["Earth", "Jupiter", "Saturn"]

Type in the missing piece of code to achieve this.

scrambled://i+=1

300s
• Q15

What is the name of the variable the while loop used to iterate?

scrambled://indexing variable

300s

Teachers give this quiz to your class