Python Conditionals Practice

Quiz
•
Computers
•
9th - 12th Grade
•
Medium
Mr Minyard
Used 7+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the following code print? ```python x = 5 if x > 4: print("Greater") else: print("Smaller") ```
Smaller
Greater
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the following code output? ```python a = 10 b = 20 if a > b: print("a is greater") else: print("b is greater") ```
a is greater
b is greater
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the following code snippet print? ```python x = 15 if x < 10: print("Less than 10") elif x < 20: print("Between 10 and 20") else: print("20 or more") ```
Less than 10
Between 10 and 20
20 or more
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following code. What will it print? ```python x = 5 y = 5 if x == y: print("x and y are equal") else: print("x and y are not equal") ```
x and y are equal
x and y are not equal
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the following code print? ```python x = 10 y = 20 if x > y: print("x is greater") elif x < y: print("y is greater") else: print("x and y are equal") ```
x is greater
y is greater
x and y are equal
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the following nested conditional code print? ```python x = 5 if x > 0: if x < 10: print("x is a positive single-digit number.") ```
x is a positive number.
x is a positive single-digit number.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the following code print? ```python x = 12 y = 5 if x > 10 and y > 10: print("Both greater than 10") else: print("At least one is not greater than 10") ```
Both greater than 10
At least one is not greater than 10
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
Python Casting and Input

Quiz
•
8th - 11th Grade
17 questions
PYTHON-Base n 1-3C

Quiz
•
11th Grade
18 questions
Foundations of Programming

Quiz
•
9th - 10th Grade
17 questions
Python Modulus & Exponent & If 305

Quiz
•
9th - 12th Grade
20 questions
Python Quiz 2

Quiz
•
9th Grade
20 questions
Procedures and Functions

Quiz
•
10th Grade
20 questions
Unit 3 Python TEST

Quiz
•
11th - 12th Grade
20 questions
Y9 - T2 - L6 - HOMEWORK

Quiz
•
9th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
10 questions
1.2 OSI & TCP IP Models Quiz

Quiz
•
10th Grade
20 questions
Digital Citizenship

Quiz
•
8th - 12th Grade
30 questions
Introduction to Computers

Quiz
•
8th - 9th Grade
35 questions
Computer Baseline Examination 2025-26

Quiz
•
9th - 12th Grade
13 questions
Problem Solving Process

Quiz
•
9th - 12th Grade
20 questions
Hardware vs. Software Quiz

Quiz
•
7th - 10th Grade
10 questions
Understanding Algorithms with Pseudocode and Flowcharts

Interactive video
•
9th - 12th Grade