For and While Loops in Python

For and While Loops in Python

9th - 12th Grade

16 Qs

quiz-placeholder

Similar activities

Python Print Statement

Python Print Statement

6th - 10th Grade

12 Qs

Loops

Loops

5th - 12th Grade

16 Qs

Python programming -recap

Python programming -recap

7th - 10th Grade

12 Qs

AP CA A Unit 4 Review

AP CA A Unit 4 Review

11th - 12th Grade

20 Qs

Control structures

Control structures

10th Grade

18 Qs

Tracing Loops in Java

Tracing Loops in Java

12th Grade

17 Qs

Basic Python

Basic Python

10th - 12th Grade

20 Qs

CS Edexcel Unit 6 Parts 4-5 - Iteration

CS Edexcel Unit 6 Parts 4-5 - Iteration

9th - 10th Grade

16 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 142+ 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?