
Python Summer internship quiz 4
Quiz
•
Other
•
University
•
Practice Problem
•
Hard
Gnaneshwar Reddy
Used 2+ times
FREE Resource
Enhance your content in a minute
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code?
for i in range(3):
pass
print(i)
a) 0
b) 1
c) 2
d) 3
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the else clause in a loop in Python?
a) To execute a block of code after the loop finishes normally without hitting a break.
b) To execute a block of code after the loop finishes regardless of whether it hit a break or not.
c) To execute a block of code before the loop starts.
d) To execute a block of code only if the loop is infinite.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code?
for i in range(5):
if i == 3:
continue
print(i)
a) 0 1 2
b) 0 1 2 3
c) 0 1 2 4
d) 0 1 2 3 4
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code?
for i in range(5):
if i == 3:
break
print(i)
a) 0 1 2 3
b) 0 1 2
c) 1 2 3
d) 0 1 2 4
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following will result in an infinite loop?
a) for i in range(1, 10, 1): print(i)
b) while True: print("Hello")
c) while False: print("Hello")
d) for i in range(10): print(i)
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How many times will "Hello" be printed in the following code?
for i in range(3):
for j in range(3):
print("Hello")
a) 3
b) 6
c) 9
d) 12
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code?
for i in range(3):
for j in range(2):
print(i, j)
a) (0, 0) (0, 1) (1, 0) (1, 1) (2, 0) (2, 1)
b) 0 0 0 1 1 0 1 1 2 0 2 1
c) (0, 0) (0, 1) (1, 0) (1, 1)
d) 0 0 1 1 2 2
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
Cont. Nacional - Aula 05 - Pancadaria
Quiz
•
University
10 questions
Taller 1 (4to): Captura y codificación de los datos en SPSS
Quiz
•
University
13 questions
Among Us
Quiz
•
1st Grade - Professio...
10 questions
¿Qué tanto se ?
Quiz
•
11th Grade - University
10 questions
CCHU5001_Week 3_Quiz
Quiz
•
University
12 questions
Kerajaan Tempatan
Quiz
•
1st Grade - Professio...
13 questions
Katasztrófavédelmi teszt
Quiz
•
University
10 questions
Redacción Técnica Científica #5
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
Discover more resources for Other
7 questions
How James Brown Invented Funk
Interactive video
•
10th Grade - University
5 questions
Helping Build the Internet: Valerie Thomas | Great Minds
Interactive video
•
11th Grade - University
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
23 questions
Subject Verb Agreement
Quiz
•
9th Grade - University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
19 questions
Review2-TEACHER
Quiz
•
University
15 questions
Pre2_STUDENT
Quiz
•
University
20 questions
Ch. 7 Quadrilateral Quiz Review
Quiz
•
KG - University
