Search Header Logo

For Loop Quiz

Authored by Michael Alves

Computers

11th Grade

Used 4+ times

For Loop Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

8 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the for loop allow us to do?

Execute code an indefinite number of times

Execute code based on user input

Execute code a predetermined number of times

Execute code only once

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the starting value of the variable 'i' in a for this loop:

for i in range(5):

1

-1

0

2

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the range function determine in a for loop?

The number of times the loop runs

The conditions for the loop to end

The number of variables used in the loop

The type of data used in the loop

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code: for i in range(4): print(i+1)?

1 2 3 4

0 1 2 3

2 3 4 5

4 3 2 1

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the value of 'i' when the loop ends in the code: for i in range(6)?

5

6

4

7

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code: for i in range(3): print('hello')?

hello

hello hello hello

hello hello hello hello

hello hello

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code: for i in range(3): print(i)?

0 1 2 3

1 2 3 4

1 2 3

0 1 2

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?