Search Header Logo

Python - For Loop & Nested Loops

Authored by Nur Hashimi

Computers

7th Grade

Used 6+ times

Python - For Loop & Nested Loops
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

12 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used to start a for loop in Python?

loop

for

repeat

while

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will for i in range(3): print(i) output?

1 2 3

0 1 2

0 1 2 3

1 2

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In for x in range(5):, how many times will the loop run?

4

5

6

Infinite

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which function generates a sequence of numbers for a loop?

list()

numbers()

range()

seq()

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a nested loop?

A loop that runs only once

A loop inside another loop

A loop without a range

A loop with a break

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In a nested loop, which loop runs faster?

The outer loop

The inner loop

Both run at same speed

None

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which statement is TRUE about for loops?

They can only loop over numbers

They can loop over strings, lists, or ranges

They run forever

They must have 3 parameters

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?