
Python Logical Operators Quiz

Quiz
•
Computers
•
9th Grade
•
Easy
JASON SAMMONS
Used 1+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 3 pts
Which of the following is not a logical operator in Python?
AND
OR
NOT
BECAUSE
2.
MULTIPLE CHOICE QUESTION
30 sec • 3 pts
Which of the following conditions tell me to sleep if my alarm did not go off (alarm = False) and I’m tired (tired = True)?
if alarm and tired: sleep
if not alarm or tired: sleep
if not alarm and tired: sleep
if not alarm and not tired: sleep
3.
FILL IN THE BLANK QUESTION
30 sec • 3 pts
How would you round the number held in the variable pi to 3.14?
4.
MULTIPLE CHOICE QUESTION
30 sec • 3 pts
Why should you use round when you compare two numbers that have type float?
If you don’t, Python will only compare the whole part and discard the decimal part.
You don’t have to, but it’s good style. All of the comparisons will still work out the same way.
Sometimes numbers can be rounded in unexpected ways based on how Python computes them. Therefore, it is best to use round in order to make sure both numbers are rounded the same way.
You should always use round when you compare two numbers, even if they are of type int.
5.
MULTIPLE CHOICE QUESTION
30 sec • 3 pts
How many lines will this program print? while True: print("hi")
1 line
100 lines
No lines at all
6.
MULTIPLE CHOICE QUESTION
30 sec • 3 pts
How many lines will this program print? x = 10 while x > 0: print(x) x = x - 3 Type the numeric response below.
4
3
5
6
7.
MULTIPLE CHOICE QUESTION
30 sec • 3 pts
Which of the following best describes the purpose of a for loop?
A for loop is for doing something an indeterminate number of times.
A for loop is doing something an infinite number of times.
A for loop is for doing something a fixed number of times.
A for loop is for doing something three times.
Create a free account and access millions of resources
Similar Resources on Wayground
13 questions
Python

Quiz
•
9th Grade
15 questions
Grade 8 End of Unit Revision

Quiz
•
8th Grade - University
15 questions
Python Basics Quiz

Quiz
•
9th Grade
10 questions
Python Variables

Quiz
•
7th - 12th Grade
15 questions
Programming python review

Quiz
•
9th - 12th Grade
12 questions
Finch Robot Review Quiz

Quiz
•
9th - 12th Grade
10 questions
1AP - N2T3

Quiz
•
9th Grade
10 questions
Python

Quiz
•
5th - 10th 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
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