
Python Practice 3

Quiz
•
Other
•
Professional Development
•
Hard
Assoc.Prof,IT Chennai
Used 1+ times
FREE Resource
12 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
To execute a block of code based on a condition
To perform mathematical operations
To repeat a block of code
To define a function
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which keyword is used to execute a block of code if the condition in the if statement is false?
else
elif
while
for
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
i = 2
while True:
if i%3 == 0:
break
print(i)
i += 2
2, 4 ,6 ,8 ,10 …,,
2 4 ,
2,3
error
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
x = 10
if x < 5:
print("x is less than 5")
elif x > 15:
print("x is greater than 15")
else:
print("x is between 5 and 15")
x is less than 5
x is greater than 15
x is between 5 and 15
no output
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
How can you exit a loop prematurely in Python?
Using the break statement
Using the continue statement
Using the pass statement
Using the exit function
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the purpose of the for loop in Python?
To execute a block of code repeatedly until a condition is false
To iterate over items in a sequence
To execute a block of code a fixed number of times
To define a function
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
fruits = ["apple", "banana", "cherry"]
for fruit in fruits:
print(fruit)
apple banana cherry
[“apple”, “banana”, “cherry”]
0 1 2
no output
Create a free account and access millions of resources
Similar Resources on Quizizz
10 questions
CI Quiz : Everyday VBA

Quiz
•
Professional Development
13 questions
day1

Quiz
•
Professional Development
10 questions
Basic Microbit

Quiz
•
11th Grade - Professi...
15 questions
Lists and operators

Quiz
•
Professional Development
15 questions
Python & SQL

Quiz
•
Professional Development
10 questions
#Sg_Spaic Last season Quiz (ML and Python)

Quiz
•
KG - Professional Dev...
10 questions
Understanding Python If Statements

Quiz
•
Professional Development
15 questions
Scratch Sprites Quiz

Quiz
•
KG - Professional Dev...
Popular Resources on Quizizz
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