Search Header Logo
Python for loop quiz 1

Python for loop quiz 1

Assessment

Presentation

Computers

11th Grade

Practice Problem

Medium

Created by

Kenneth Tai

Used 7+ times

FREE Resource

0 Slides • 7 Questions

1

Multiple Choice

1.       Which of the following is a correct "for loop" syntax in Python?

1

for i = 1 to 10 do

2

for i in range(1,10)

3

for i in range(1,10):

4

for i in range(10) do

2

Multiple Choice

2.       What is the output of the following for loop?

for i in range(5): print(i)

1

0

1

2

3

4

2

1

2

3

4

5

3

0

1

2

3

4

5

4

1

2

3

4

3

Multiple Choice

3.       What is the output of the following for loop?

for i in range(5, 1, -1): print(i)

1

5

4

3

2

1

2

5

4

3

2

3

4

3

2

1

4

4

3

2

4

Multiple Choice

4.       What is the output of the following for loop?

for i in range(1, 6, 2): print( i )

1

1

2

3

4

5

2

1

3

5

3

2

4

6

4

1

6

5

Multiple Choice

5.       What is the output of the following for loop?

for i in range(4): print( i * 2 )

1

0

1

2

3

2

1

2

3

4

3

2

4

6

8

4

0

2

4

6

6

Multiple Choice

6.       What is the output of the following for loop?

for i in range(4): print( 4 - i )

1

0

1

2

3

2

3

2

1

0

3

4

3

2

1

4

4-0

4-1

4-2

4-3

7

Multiple Choice

7.       What is the output of the following for loop?

for i in range(4): print( 2 * i + 1 )

1

1

3

5

7

2

0

2

4

6

3

1

3

5

7

9

4

0

3

5

7

1.       Which of the following is a correct "for loop" syntax in Python?

1

for i = 1 to 10 do

2

for i in range(1,10)

3

for i in range(1,10):

4

for i in range(10) do

Show answer

Auto Play

Slide 1 / 7

MULTIPLE CHOICE