FOR Loop Python

FOR Loop Python

6th - 8th Grade

13 Qs

quiz-placeholder

Similar activities

Python - Loops & Lists

Python - Loops & Lists

7th - 11th Grade

15 Qs

Python strings

Python strings

8th - 9th Grade

11 Qs

10.4 Python Lists

10.4 Python Lists

7th - 10th Grade

14 Qs

Loops

Loops

5th - 12th Grade

16 Qs

MicroBit Revision

MicroBit Revision

7th Grade

15 Qs

PYTHON (FOR LOOP)

PYTHON (FOR LOOP)

1st - 10th Grade

10 Qs

Iteration Recap

Iteration Recap

8th - 9th Grade

16 Qs

Python Basics

Python Basics

KG - University

16 Qs

FOR Loop Python

FOR Loop Python

Assessment

Quiz

Computers

6th - 8th Grade

Medium

Created by

Andrew Kale

Used 1+ times

FREE Resource

13 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax for a basic for loop in Python?

for i in range(5):

for (i = 0; i < 5; i++)

foreach i in range(5):

loop i in range(5):

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What does the following code print?

1, 2, 3

0, 1, 2

0, 1, 2, 3

3, 2, 1

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is the output of this code?

2, 3, 4, 5

2, 3, 4

3, 4, 5

1, 2, 3, 4

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What does this code do?

Prints each character on a new line

Repeats the whole string

Prints ASCII values

Throws an error

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is the output of this code?

5, 4, 3, 2

5, 4, 3, 2, 1

1, 2, 3, 4, 5

5, 4, 3, 2, 1, 0

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of break?

Exit loop immediately

Skip iteration

Restart loop

Pause execution

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of continue?

Exit loop immediately

Skip current iteration

Restart loop

Pause temporarily

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?