loops

loops

Professional Development

15 Qs

quiz-placeholder

Similar activities

PYTHON ::04

PYTHON ::04

University - Professional Development

17 Qs

IOT Introduction Quiz

IOT Introduction Quiz

Professional Development

10 Qs

Python_2R

Python_2R

KG - Professional Development

20 Qs

python loop practice

python loop practice

Professional Development

12 Qs

Python Training Day-6 Quiz-6

Python Training Day-6 Quiz-6

Professional Development

10 Qs

DECI - Week 9 - round

DECI - Week 9 - round

Professional Development

12 Qs

Practice Test Operator and Control Flow Statement 01

Practice Test Operator and Control Flow Statement 01

Professional Development

15 Qs

Flutter Online Quiz

Flutter Online Quiz

Professional Development

18 Qs

loops

loops

Assessment

Quiz

Computers

Professional Development

Medium

Created by

KEERTHI BADUGU

Used 5+ times

FREE Resource

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

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?