
if, elif, and else Conditionals

Quiz
•
Computers
•
9th - 12th Grade
•
Medium
Bryan Campbell
Used 13+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the purpose of the if statement in Python?
To declare a variable
To loop through a sequence
To perform conditional execution of code
To define a function
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
How many possible values are there for a boolean variable?
1
2
3
4
3.
MULTIPLE CHOICE QUESTION
1 min • 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.
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
In Python, how is the if statement terminated?
With a semicolon
With a colon
With a period
With an exclamation mark
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is not a logical operator in Python?
and
or
not
because
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following programs will run but will not print anything?
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Mr. Ramesh is writing a Python program to check if Carlos and Charlie have both completed their homework. He wants to use the and operator in an if statement. What is the purpose of the and operator in this context?
It is used for bitwise operations
It combines two conditions, and both must be true for the if statement to execute
It is used to exit a loop
It is used for logical negation
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
Python Basics Quiz

Quiz
•
9th - 12th Grade
15 questions
Python бағдарламалау тілі

Quiz
•
11th Grade
17 questions
Python Conditionals

Quiz
•
9th - 11th Grade
20 questions
Python IF statements Part 4

Quiz
•
9th - 12th Grade
20 questions
Python Basics Review (TSK)

Quiz
•
9th - 12th Grade
20 questions
Control Statements in Python

Quiz
•
11th Grade
16 questions
Python basics

Quiz
•
9th - 12th Grade
15 questions
Python 3 Elements Quiz

Quiz
•
9th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

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

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th 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
20 questions
Analog vs Digital

Quiz
•
9th - 12th Grade
10 questions
CTEA Computer Vocab Terms #1

Quiz
•
12th Grade
10 questions
Exploring Cybersecurity Techniques and Threats

Interactive video
•
6th - 10th Grade
10 questions
Understanding the Internet and Data Transmission

Interactive video
•
7th - 12th Grade