What will be the output of this loop with a break statement?
for i in range(5):
if i == 3:
break
print(i)
Python Programming Quiz 3
Quiz
•
Mathematics
•
Professional Development
•
Medium
Suraj Singh
Used 2+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of this loop with a break statement?
for i in range(5):
if i == 3:
break
print(i)
0 1 2
0 1 2 3 4
1 2 3
Error
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code? for i in range(3): print(i * 2)
2 4 6
0 2 4
0 1 2
1 2 3
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code? count = 0 while count < 3: print(count) count += 1
0 1 2
0 1 2 3
1 2 3
Error
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code? for i in range(4): if i == 2: continue print(i)
0 1 2 3
0 1 3
1 2 3
Error
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of this code snippet? count = 5 while count > 0: print(count) count -= 2
5 3 1
5 4 3 2 1
5 3
Error
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code? for i in range(2, 6): print(i + 1)
2 3 4 5 6
1 2 3 4 5
3 4 5 6 7
2 3 4 5
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
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
10 questions
Math Ice Breaker
Quiz
•
Professional Development
10 questions
Mathematics Quiz
Quiz
•
8th Grade - Professio...
5 questions
Pre-Lesson Quiz
Quiz
•
Professional Development
6 questions
Maths Quiz - Level 1 - MUST KNOW – Part 6
Quiz
•
Professional Development
15 questions
Quiz-1
Quiz
•
University - Professi...
10 questions
Descriptive statistics
Quiz
•
University - Professi...
14 questions
GEMATMW - Golden Ratio and Fibonacci Sequence
Quiz
•
7th Grade - Professio...
10 questions
University maths
Quiz
•
10th Grade - Professi...
15 questions
Multiplication Facts
Quiz
•
4th Grade
20 questions
Math Review - Grade 6
Quiz
•
6th Grade
20 questions
math review
Quiz
•
4th Grade
5 questions
capitalization in sentences
Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance
Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions
Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines
Quiz
•
Professional Development
12 questions
Dividing Fractions
Quiz
•
6th Grade