Search Header Logo

Pyhton-Loops

Authored by Zubaidah Shaheen

Computers

9th Grade

Used 6+ times

Pyhton-Loops
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

23 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How many lines will this program print?

while True:

print("hi")

0

1

  1. an infinite number of lines

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How many lines will this program print?

x = 10

while x > 0:

print(x)

x = x - 3

3

4

5

6

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following best describes the purpose of a for loop?

A for loop is for doing something an indeterminate number of times.

A for loop is doing something an infinite number of times.

A for loop is for doing something a fixed number of times.

A for loop is for doing something three times.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following programs prints ten lines?

for i in range(10): print("hi")

for i = 1 to 10: print("hi")

for i in 1 - 10: print("hi")

for i from 0 to 9: print("hi")

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If I am using the following condition in my program:

while True:

which keyword should I use to make sure I don’t create an infinite loop?

break

continue

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which Python keyword skips back to the beginning of a loop?

break

continue

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following does not properly nest control structures?

Media Image
Media Image
Media Image
Media Image

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?