
Python Logical Operators Quiz
Quiz
•
Other
•
9th Grade
•
Practice Problem
•
Medium
Emilio Gasca
Used 11+ times
FREE Resource
Enhance your content in a minute
9 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is not a logical operator in Python?
A. and
B. or
C. not
D. because
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following conditions tell me to sleep if my alarm did not go off (alarm = False) and I’m tired (tired = True)?
A. if alarm and tired: sleep
B. if not alarm or tired: sleep
C. if not alarm and tired: sleep
D. if not alarm and not tired: sleep
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Assume you are writing a program, and you have a boolean variable called b, defined like so: b = True. Pick the correct if statement to follow the code above. The if statement should be correct Python, and the body of the if statement should only run if b is True.
A. if b: print("b is True!")
B. if b: print("b is True!")
C. if True: print(b)
D. if True: print(b)
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following programs will run but will not print anything?
A. x = True if x: print("hi")
B. if False: print("hi")
C. x = False if x: print("hi") else: print("hello")
D. if True:
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following evaluates to the variable x rounded to two decimal places?
round(x, 2)
round(2, x)
round(x), 2
round(2), x
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following values is rounded to 3 decimal places?
2.3
3.000
3.0001
3
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does this Python expression evaluate to? 100 != 100
True
False
“True”
“False”
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
13 questions
Rugby law: 8 Scoring
Quiz
•
9th - 12th Grade
10 questions
THE PATASOLA
Quiz
•
KG - Professional Dev...
10 questions
Guess the blackpink song lyrics
Quiz
•
4th Grade - Professio...
9 questions
True Experimental Research Designs
Quiz
•
9th Grade
10 questions
lenguaje algebraico
Quiz
•
9th - 11th Grade
10 questions
Duty of Care
Quiz
•
1st - 10th Grade
11 questions
Orders to the Sentry
Quiz
•
9th - 12th Grade
10 questions
ทดสอบความรู้
Quiz
•
9th Grade
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 Other
20 questions
El Verbo IR Practice
Quiz
•
9th Grade
10 questions
Understanding Meiosis
Interactive video
•
6th - 10th Grade
20 questions
Graphing Inequalities on a Number Line
Quiz
•
6th - 9th Grade
15 questions
Main Idea and Supporting Details.
Quiz
•
4th - 11th Grade
10 questions
Theme
Quiz
•
9th Grade
12 questions
Exponential Growth and Decay
Quiz
•
9th Grade
20 questions
Exponent Rules Review
Quiz
•
8th - 9th Grade
25 questions
Complementary and Supplementary Angles
Quiz
•
7th - 10th Grade
