Pyhton-Loops

Pyhton-Loops

9th Grade

23 Qs

quiz-placeholder

Similar activities

looping and branching statements in C

looping and branching statements in C

9th Grade

20 Qs

Python For And While Loop

Python For And While Loop

8th - 12th Grade

20 Qs

J277 - basic testing and errors

J277 - basic testing and errors

9th - 12th Grade

22 Qs

Code HS JavaScript Control Structures

Code HS JavaScript Control Structures

9th - 12th Grade

20 Qs

CodeHS - Intro to Python - Basics and Console Interaction

CodeHS - Intro to Python - Basics and Console Interaction

9th Grade - Professional Development

20 Qs

Python Unit 3 Review

Python Unit 3 Review

9th Grade

20 Qs

Python basics

Python basics

7th - 10th Grade

18 Qs

Fun with Loops

Fun with Loops

9th Grade

20 Qs

Pyhton-Loops

Pyhton-Loops

Assessment

Quiz

Computers

9th Grade

Medium

Created by

Zubaidah Shaheen

Used 6+ times

FREE Resource

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

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?