
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
30 questions
sisitemas de arch
Quiz
•
University
33 questions
ELECTRICAL ENGINEERS PRE-BOARD EXAMINATION MARCH 2015
Quiz
•
University
25 questions
[Part 3] Midterm Exam in MATH 153 - Analytic Geometry Plus
Quiz
•
University
30 questions
C Programming
Quiz
•
University
29 questions
Electricity Final Quiz
Quiz
•
9th Grade - University
30 questions
LEYES DE NEWTON
Quiz
•
University
30 questions
Kontrol Otomatik TEP C 2025
Quiz
•
University
31 questions
Instrumentation L2: Temperature, Pressure, Level, and Flow #3
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
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
20 questions
Figurative Language Review
Quiz
•
6th Grade
Discover more resources for Engineering
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
23 questions
Subject Verb Agreement
Quiz
•
9th Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
5 questions
Poetry Interpretation
Interactive video
•
4th Grade - University
19 questions
Black History Month Trivia
Quiz
•
6th Grade - Professio...
15 questions
Review1
Quiz
•
University
15 questions
Pre1
Quiz
•
University
