Search Header Logo

Python For Loop Quiz

Authored by Michael Alves

Computers

11th Grade

Used 23+ times

Python For Loop Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

7 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the starting value of the variable 'I' in the for loop if we use the range function with two parameters?

for i in range(3, 10):

0

1

2

3

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the second parameter in the range function indicate?

Ending value for 'I'

None of the above

Increment for 'I'

Starting value for 'I'

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In this example where the loop goes from 1 to 9 in two step increments, what is the ending value for 'I'?

for i in range(1, 9, 2):

11

10

8

9

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In this example, what is the ending value for 'I'?

for i in range(10, 0, -1):

-1

1

10

0

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In a for loop where the loop counts up to 100 by twos, what is the ending value for 'I'?

for i in range(0, 100, 2):

98

100

97

99

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way to specify an increment in the range function?

None of the above

Both A and B

Two parameter version

Three parameter version

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What can the number in the range function be if it's a variable?

An expression that evaluates to an integer

Only an integer

Only a string

Only a float

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?