Search Header Logo

Python Loops

Authored by Elaine Cortez

Computers

University

Used 346+ times

Python Loops
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

17 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

In programming, what is iteration/looping?

The repetition of steps within a program

The order in which instructions are carried out

A decision point in a program

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Why is iteration important?

It determines the order in which instructions are carried out
It allows code to be simplified by removing duplicated steps
It allows multiple paths through a program

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is iteration known as?

Looping
Crashing
Repeating

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

numbers = [5, 14, 9, 17]

for number in numbers:

if number % 3 == 0:

print(number)


The output will be?

17

9

14

9

17

14

17

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

numbers = [5, 14 ,9, 17]

for number in numbers:

if number >= 9:

print (number)


The output will be?

17

9

14

9

17

14

17

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

Which of the following will print:

for i in range(1, 5):   
print(str(i) * 5)
for i in range(1, 5):   
print("i" * i)
for i in range(1, 6):   
print("i" * i)
for i in range(1, 6):   
print(str(i) * i)

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be printed after running this FOR loop:

for number in range(6):
 
    print(number)

The number 6 
The numbers 0 - 5
The number 5
The numbers 1 - 6

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

Microsoft

Continue with Microsoft

or continue with

Facebook

Facebook

Apple

Apple

Others

Others

Already have an account?