Python For Loops

Python For Loops

Assessment

Flashcard

Computers

10th Grade

Practice Problem

Easy

Created by

Wayground Content

Used 1+ times

FREE Resource

Student preview

quiz-placeholder

32 questions

Show all answers

1.

FLASHCARD QUESTION

Front

What is the syntax of a for loop in Python?

Back

for item in iterable:
# code to be executed

2.

FLASHCARD QUESTION

Front

How do you use the range() function in a for loop?

Back

Specify the start, stop, and step values within the range() function.

3.

FLASHCARD QUESTION

Front

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

Back

0
1
2
3
4

4.

FLASHCARD QUESTION

Front

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

Back

1
2
3
4
5

5.

FLASHCARD QUESTION

Front

What is the output of the following code?
for i in range(1, 10, 2):
print(i)

Back

1
3
5
7
9

6.

FLASHCARD QUESTION

Front

What is the output of the following code?
for i in range(10, 1, -1):
print(i)

Back

10
9
8
7
6
5
4
3
2

7.

FLASHCARD QUESTION

Front

How do you iterate over a list using a for loop? Options: for i in range(len(my_list)): , for item in range(my_list): , for item in my_list() , for item in my_list:

Back

for item in my_list:

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?

Discover more resources for Computers