For and While Loops in Python

For and While Loops in Python

9th - 12th Grade

16 Qs

quiz-placeholder

Similar activities

For Loop python

For Loop python

5th - 12th Grade

19 Qs

Loops in Python !

Loops in Python !

11th Grade

15 Qs

C++ Loop

C++ Loop

12th Grade

20 Qs

Python Lists

Python Lists

10th Grade

14 Qs

Iteration

Iteration

9th - 12th Grade

15 Qs

Python - Iteration (For Loops)

Python - Iteration (For Loops)

10th Grade

20 Qs

Loops

Loops

5th - 12th Grade

16 Qs

Python while loops

Python while loops

12th Grade

20 Qs

For and While Loops in Python

For and While Loops in Python

Assessment

Quiz

Computers

9th - 12th Grade

Hard

Created by

Lauren Tan

Used 143+ times

FREE Resource

16 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

The program above

prints all the odd numbers between 1 and 20

prints all even numbers between 1 and 20

print all the odd numbers between 1 and 21

prints all the even numbers between 1 and 21

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

The equivalent of the above for loop using the while syntax would be

Media Image
Media Image
Media Image
Media Image

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

The above program prints

Numbers 1 to 10 in reverse order

Numbers 1 to 11 in reverse order

Numbers 1 to 10

Numbers 1 to 11

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

Look at the following code, what will it generate

1,2,3,4,5,6,7,8,9,10,11,12

0,1,2,3,4,5,6,7,8,9,10,11,12

1,2,3,4,5,6,7,8,9,10,11,12,13

0,1,2,3,4,5,6,7,8,9,10,11,12,13

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image
Media Image
Media Image
Media Image

1,2,3,4

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What best describes what is printed by the following code?

Prints the numbers 0 through 6

Prints

h

e

l

l

o

w

Prints the phrase "hello world!" 7 times

Prints "hello w" 7 times

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What best describes what is printed by the following code?

Prints the numbers 0 through 6

Prints

h

e

l

l

o

w

Prints the phrase "hello world!" 7 times

Prints "hello w" 7 times

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?