loops

loops

Professional Development

15 Qs

quiz-placeholder

Similar activities

Microsoft 365 for Teachers

Microsoft 365 for Teachers

Professional Development

10 Qs

SEC+ Ch.8 Review Test

SEC+ Ch.8 Review Test

Professional Development

15 Qs

Introduction to Excel

Introduction to Excel

KG - Professional Development

10 Qs

Python Quiz For Starters

Python Quiz For Starters

3rd Grade - Professional Development

17 Qs

Ngobrolin-TI

Ngobrolin-TI

Professional Development

10 Qs

Penilaian Pengetahuan 2 KSK2023

Penilaian Pengetahuan 2 KSK2023

Professional Development

12 Qs

EXAMEN PRIMER TRIMESTRE 8VO "B" -Hardware y Software

EXAMEN PRIMER TRIMESTRE 8VO "B" -Hardware y Software

Professional Development

20 Qs

NHANH TAY, NHANH MẮT

NHANH TAY, NHANH MẮT

Professional Development

10 Qs

loops

loops

Assessment

Quiz

Computers

Professional Development

Practice Problem

Medium

Created by

KEERTHI BADUGU

Used 5+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Q1. What is the main purpose of the break statement in Python?

A. Skips the current iteration

B. Stops the loop entirely

C. Restarts the loop

D. Ignores the loop condition

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Q2. What is the main purpose of the continue statement in Python?





A. Ends the program

B. Skips the current iteration and moves to the next

C. Stops the loop entirely

D. Starts the loop again from the beginning

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Q3. What will be the output?

for i in range(5):

if i == 2:

break

print(i)

A. 0 1


B. 0 1 2

C. 2 3 4

D. 0 1 2 3 4

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Q4. What will be the output?

for i in range(5):

if i == 2:

continue

print(i)



A. 0 1 3 4

B. 0 1 2 3 4

C. 2 3 4

D. 0 1 2 4

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Q5. Which of the following loops can use break and continue?

A. for loop only


B. while loop only

C. Both for and while loops

D. Only nested loops

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Q6. What will the following code print?

i = 1

while i <= 5:

if i == 3:

break

print(i) i += 1

A. 1 2 3

B. 1 2

C. 3 4 5

D. 1 2 4 5

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Q7. What will the following code print?

i = 1

while i <= 5:

i += 1

if i == 3:

continue

print(i)

A. 1 2 4 5 6

B. 2 4 5 6

C. 3 4 5

D. 1 3 5

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?