
Python If Statements and Logical Operators Quiz
Quiz
•
Computers
•
9th - 11th Grade
•
Hard
Helen Laleendra
Used 10+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What should you always terminate an if statement with in Python?
A semicolon
A period
A colon
A comma
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of indentation in Python if statements?
To make the code look neat
To indicate the end of the if block
To indicate which statements belong to the if block
To separate different blocks of code
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be printed if the temperature is set to 35?
It's cold
It's warm
Nothing will be printed
It's nice
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the 'elif' keyword stand for?
If
If else
Else
Else if
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the recommended number of white spaces for indentation according to PEP 8?
4
3
2
5
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a ternary operator used for in Python?
To compare three values
To assign a value to a variable based on a condition
To perform three operations at once
To create a loop
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which logical operator would you use to check if both conditions are true?
XOR
NOT
OR
AND
Create a free account and access millions of resources
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
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
10 questions
Programming - Selection in an Algorithm
Quiz
•
1st - 11th Grade
10 questions
Prototypes
Quiz
•
5th - 11th Grade
11 questions
J277 Key Terms Homework 1
Quiz
•
9th - 11th Grade
15 questions
Basic Charts & Graphs
Quiz
•
9th - 12th Grade
10 questions
Excel Chart Vocabulary
Quiz
•
9th - 12th Grade
15 questions
Unit 4 Conditionals Assignment
Quiz
•
11th - 12th Grade
15 questions
Artificial Immune System AIS versus the Human Immune System
Quiz
•
10th - 11th Grade
11 questions
43. Algorithms - Merge Sort Quiz
Quiz
•
9th Grade
Popular Resources on Wayground
20 questions
Brand Labels
Quiz
•
5th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World
Quiz
•
3rd - 12th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
20 questions
ELA Advisory Review
Quiz
•
7th Grade
15 questions
Subtracting Integers
Quiz
•
7th Grade
22 questions
Adding Integers
Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns
Quiz
•
3rd Grade
10 questions
Exploring Digital Citizenship Essentials
Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials
Interactive video
•
6th - 10th Grade
30 questions
Computer Terminology Exercise #1 ( Fill Ins)
Quiz
•
9th Grade
15 questions
MLA Formatting
Quiz
•
9th Grade
20 questions
Typing Practice
Quiz
•
7th - 12th Grade
14 questions
Inputs and Outputs: Computer Science Intro
Lesson
•
5th - 9th Grade
20 questions
Google Sheets Quiz
Quiz
•
9th Grade