Python Flow Control

Python Flow Control

9th - 12th Grade

10 Qs

quiz-placeholder

Similar activities

Python Intro

Python Intro

8th - 9th Grade

10 Qs

Python_Loop(for) _high level

Python_Loop(for) _high level

9th Grade

15 Qs

Python Review 2023-01-12

Python Review 2023-01-12

9th - 12th Grade

10 Qs

Python Basics Quiz

Python Basics Quiz

6th - 10th Grade

15 Qs

Quiz 120.2B - Subroutines (recognising key terms)

Quiz 120.2B - Subroutines (recognising key terms)

11th Grade

10 Qs

Python Loops

Python Loops

9th - 12th Grade

10 Qs

Python strings

Python strings

8th - 9th Grade

11 Qs

Python - Loops & Lists

Python - Loops & Lists

7th - 11th Grade

15 Qs

Python Flow Control

Python Flow Control

Assessment

Quiz

Computers

9th - 12th Grade

Hard

Created by

Samuel Markham

Used 6+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Consider the Python code snippet shown.

What is the value of the 'total' variable after this code is executed?

0

3

6

10

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In Python, what is the purpose of the "break" statement in a loop?

It skips the current iteration and continues to the next one

It exits the loop prematurely

It prints a message to the console

It restarts the loop from the beginning

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Consider the code snippet shown.

What will be the output of this code?

5, 4, 3

5, 4, 3, 2

5, 4, 3, 2, 1

2, 1

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is not a comparison operator in Python?

==

<=

&&

>

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Consider the code snippet shown.

What will be the output of this code?

1,2,3

1,2,3,4

1,2,3,4,5,6

1,2,3,2,4,3

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the "continue" statement do in a loop in Python?

Exits the loop

Skips the remining code in current iteration and starts the next one

Starts a new iteration

Raises an error

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Consider the following code snippet.

What will be the output of the code?

1,3,5

2,4

1,2,3,4,5

1,3

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?