
Python Quiz: Decision Statements & Loops
Quiz
•
Engineering
•
University
•
Practice Problem
•
Medium
Renu Popli
Used 7+ times
FREE Resource
Enhance your content in a minute
30 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct syntax of an `if` statement in Python?
if (x > 5)
if x > 5:
if x > 5 { }
if x > 5 then:
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which keyword is used to check multiple conditions in Python?
elseif
elif
else if
ifelse
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code? x = 7 if x % 2 == 0: print("Even") else: print("Odd")
Even
Odd
7
Error
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is NOT a valid relational operator in Python?
!=
<>
>=
<
5.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
Consider this code: x = 10 if x > 5: print("A") if x > 8: print("B") What will be the output?
A
B
A B
None
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which statement is true about the `else` block in Python?
It must always follow `if`
It must always follow `elif`
It can follow `if` or `elif`
It is optional
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output? a = 3 if a == 3: print("Yes") else: print("No")
Yes
No
3
Error
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
25 questions
ITL_Chap1
Quiz
•
University
27 questions
Hackharbor 3.0 : Day 5 API and JSON Quiz
Quiz
•
University
25 questions
FISIKA 2
Quiz
•
10th Grade - University
26 questions
Dams: The Impact and Function
Quiz
•
10th Grade - University
28 questions
Solid Solutions and Phase Diagrams
Quiz
•
University
30 questions
Basic Safety Precautions
Quiz
•
University
35 questions
Management Quiz
Quiz
•
University
30 questions
2.1.2 - Teamwork in Engineering
Quiz
•
10th Grade - University
Popular Resources on Wayground
8 questions
2 Step Word Problems
Quiz
•
KG - University
20 questions
Comparing Fractions
Quiz
•
4th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Latin Bases claus(clois,clos, clud, clus) and ped
Quiz
•
6th - 8th Grade
22 questions
fractions
Quiz
•
3rd Grade
7 questions
The Story of Books
Quiz
•
6th - 8th Grade
Discover more resources for Engineering
8 questions
2 Step Word Problems
Quiz
•
KG - University
7 questions
Comparing Fractions
Interactive video
•
1st Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
10 questions
14.2 Independent/Dependent Variables
Quiz
•
KG - University
18 questions
Great Lakes States
Quiz
•
KG - University
7 questions
DNA, Chromosomes, Genes, and Traits: An Intro to Heredity
Interactive video
•
11th Grade - University
7 questions
Reflexive Verbs in Spanish
Lesson
•
9th Grade - University
7 questions
Narrative Writing 1
Interactive video
•
4th Grade - University
