
CodeHS - Intro to Python - Conditionals Quiz
Authored by Halil Ozer
Computers
9th Grade - Professional Development
Used 180+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
About
This quiz focuses on Python programming fundamentals, specifically conditional statements and data types, making it appropriate for grades 9-12 in an introductory computer science course. The questions systematically assess students' understanding of Boolean expressions, if-elif-else statement structures, comparison operators, logical operators (and, or), data type identification, and floating-point number handling. Students need to demonstrate their ability to trace through code execution step-by-step, evaluate Boolean conditions in proper order, understand how Python processes nested conditionals, and recognize the differences between independent if statements versus if-elif chains. The quiz also tests knowledge of built-in functions like type() and round(), requiring students to predict exact program output rather than simply understanding conceptual programming ideas. Created by Halil Ozer, a Computers teacher in US who teaches grade 9-14. This quiz serves as an excellent formative assessment tool for students learning Python conditionals, allowing teachers to identify specific misconceptions about Boolean logic and control flow before they become entrenched. It works particularly well as a review activity after introducing conditional statements, as homework to reinforce classroom learning, or as a warm-up exercise to activate prior knowledge before advancing to more complex programming concepts. The quiz can also function as a diagnostic tool to determine which students need additional support with code tracing and logical reasoning skills. The content directly supports Common Core Mathematical Practice standards MP1 (Make sense of problems and persevere in solving them) and Computer Science Teachers Association standards 1A-AP-10 (Develop programs with sequences and simple loops) and 1A-AP-15 (Using correct terminology, describe steps taken and choices made during program development).
Content View
Student View
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will print to the screen when the following program is run?
number = 5
greater_than_zero = number > 0
print(type(number))
5
True
<type ‘int’>
<type ‘bool’>
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will print to the screen when the following program is run?
number = 5
less_than_zero = number < 0
print(type(less_than_zero))
5
False
<type ‘int’>
<type ‘bool’>
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of this program?
number = 5
greater_than_zero = number > 0
if greater_than_zero:
print(number)
0
5
True
Nothing will print
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of this program?
number = 5
greater_than_zero = number > 0
if greater_than_zero:
if number > 5:
print(number)
0
5
True
Nothing will print
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of this program?
number = 5
less_than_zero = number < 0
if less_than_zero:
print(number)
number = number - 10
less_than_zero = number < 0
if less_than_zero:
print(number)
5
5
-5
5
-5
Nothing will print
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of this program?
number = 5
greater_than_zero = number > 0
less_than_zero = number < 0
if greater_than_zero:
print(number)
if less_than_zero:
print(number + 1)
if greater_than_zero and less_than_zero:
print(number + 2)
if greater_than_zero or less_than_zero:
print(number + 3)
5
5
7
5
7
8
5
8
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will the following program print when run?
above_16 = True
has_permit = True
passed_test = False
if above_16 and has_permit and passed_test:
print("Issue Driver's License")
elif above_16 or has_permit or passed_test:
print("Almost eligible for Driver's License")
else:
print("No requirements met.")
Issue Driver’s License
Almost eligible for Driver’s License
No requirements met
Nothing will print
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?
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