WorksheetsU6/L2 HS Kira- Complex Conditionals
Total questions: 17
Worksheet time: 9mins
In programming, which term describes statements that allow a program to make decisions based on whether a condition is true or false?
Loops
Conditionals
Variables
Functions
Which option best defines operators in code?
Labels for data types
Symbols or words used to perform operations like comparisons or math
Comments that document code
Blocks that group multiple statements
Which operator is used to check if two values are equal and returns True when both values match?
!=
==
>
<
What does the operator != check?
If two values are equal
If two values are not equal
If the left value is greater than the right value
If both conditions are true
Which operator checks if the value on the left is greater than the one on the right?
>
<
==
!=
Which operator checks if the value on the left is less than the one on the right?
>
<
==
and
Logical operators allow you to combine conditions. What does the and operator return if both conditions are true?
Correct
True
False
The opposite of the condition
The or operator returns True if ___________ of the conditions is true.
all
at least one
both
neither
What does the not operator do to the value of a condition (makes True become False and vice versa)?
Leaves it unchanged
Converts numbers to strings
Reverses it
Compares two values for equality
Given the Python code: if isHungry and hasSnacks: print("Eat your snack!") — When will this code run?
Only when isHungry is True
Only when hasSnacks is True
When both isHungry and hasSnacks are True
When either isHungry or hasSnacks is True
In the activity context, which type of operators were practiced to evaluate conditions in a real‑world‑style coding problem?
Arithmetic operators
Logical operators
Comparison operators
Bitwise operators
Complete the reasoning for the Python condition: if temperature > 90 or isSunny == True: print("Wear sunscreen!") — Under which situation will the code run?
Only when temperature is greater than 90 and isSunny is True
When temperature is greater than 90 or isSunny is True
Only when temperature equals 90
Only when isSunny is False
Which set of operators is best used for comparing values rather than performing arithmetic?
+ , - , *
== , != , > , <
and , or , not
= , += , –=
In Python, which keyword correctly combines two conditions so that both must be true before the if-body runs?
and
or
not
elif
Consider the code snippet shown in the image: if 8 < 10 and 2 == 3: print("This will run.") Which best describes whether the message prints and why?
It does not print because 8 < 10 is False and both conditions must be True.
It does not print because 2 == 3 is False, making the entire and condition False.
It prints because at least one condition is True when using and.
It prints because both comparisons evaluate to True.
A concert app should allow entry only if a user is over 18 and has a valid ticket code. Which single-line if condition most closely enforces this rule?
if age > 18 or hasTicket:
if age > 18 and hasTicket:
if hasTicket and age < 18
if hasTicket or age < 18:
A delivery bot should dispatch a package only when the customer has paid and the address is verified; otherwise it waits. Which condition correctly models this using logical operators?
if paid or address_verified:
if not paid and not address_verified:
if paid and address_verified:
if paid and not address_verified:
