Python For Loop Quiz

Python For Loop Quiz

11th Grade

7 Qs

quiz-placeholder

Similar activities

Quiz 16 - Arrays and Loops

Quiz 16 - Arrays and Loops

11th Grade

10 Qs

Struktur Kontrol Perulangan

Struktur Kontrol Perulangan

10th - 11th Grade

10 Qs

KODEKIDDO HACK #MLH3

KODEKIDDO HACK #MLH3

4th Grade - University

10 Qs

Mixed Review Python

Mixed Review Python

9th - 12th Grade

10 Qs

Intro to Scratch 2

Intro to Scratch 2

KG - University

12 Qs

conditional and iterative statements

conditional and iterative statements

11th Grade

10 Qs

algoritma dan pemograman

algoritma dan pemograman

9th - 12th Grade

10 Qs

PLTW Final Review Part 2

PLTW Final Review Part 2

9th - 12th Grade

10 Qs

Python For Loop Quiz

Python For Loop Quiz

Assessment

Quiz

Computers

11th Grade

Medium

Created by

Michael Alves

Used 8+ times

FREE Resource

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