Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

U6/L2 HS Kira- Complex Conditionals

Total questions: 17

Worksheet time: 9mins

Name
Class
Date
1.

In programming, which term describes statements that allow a program to make decisions based on whether a condition is true or false?

a)

Loops

b)

Conditionals

c)

Variables

d)

Functions

2.

Which option best defines operators in code?

a)

Labels for data types

b)

Symbols or words used to perform operations like comparisons or math

c)

Comments that document code

d)

Blocks that group multiple statements

3.

Which operator is used to check if two values are equal and returns True when both values match?

a)

!=

b)

==

c)

>

d)

<

4.

What does the operator != check?

a)

If two values are equal

b)

If two values are not equal

c)

If the left value is greater than the right value

d)

If both conditions are true

5.

Which operator checks if the value on the left is greater than the one on the right?

a)

>

b)

<

c)

==

d)

!=

6.

Which operator checks if the value on the left is less than the one on the right?

a)

>

b)

<

c)

==

d)

and

7.

Logical operators allow you to combine conditions. What does the and operator return if both conditions are true?

a)

Correct

b)

True

c)

False

d)

The opposite of the condition

8.

The or operator returns True if ___________ of the conditions is true.

a)

all

b)

at least one

c)

both

d)

neither

9.

What does the not operator do to the value of a condition (makes True become False and vice versa)?

a)

Leaves it unchanged

b)

Converts numbers to strings

c)

Reverses it

d)

Compares two values for equality

10.

Given the Python code: if isHungry and hasSnacks: print("Eat your snack!") — When will this code run?

a)

Only when isHungry is True

b)

Only when hasSnacks is True

c)

When both isHungry and hasSnacks are True

d)

When either isHungry or hasSnacks is True

11.

In the activity context, which type of operators were practiced to evaluate conditions in a real‑world‑style coding problem?

a)

Arithmetic operators

b)

Logical operators

c)

Comparison operators

d)

Bitwise operators

12.

Complete the reasoning for the Python condition: if temperature > 90 or isSunny == True: print("Wear sunscreen!") — Under which situation will the code run?

a)

Only when temperature is greater than 90 and isSunny is True

b)

When temperature is greater than 90 or isSunny is True

c)

Only when temperature equals 90

d)

Only when isSunny is False

13.

Which set of operators is best used for comparing values rather than performing arithmetic?

a)

+ , - , *

b)

== , != , > , <

c)

and , or , not

d)

= , += , –=

14.

In Python, which keyword correctly combines two conditions so that both must be true before the if-body runs?

a)

and

b)

or

c)

not

d)

elif

15.

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?

a)

It does not print because 8 < 10 is False and both conditions must be True.

b)

It does not print because 2 == 3 is False, making the entire and condition False.

c)

It prints because at least one condition is True when using and.

d)

It prints because both comparisons evaluate to True.

16.

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?

a)

if age > 18 or hasTicket:

b)

if age > 18 and hasTicket:

c)

if hasTicket and age < 18

d)

if hasTicket or age < 18:

17.

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?

a)

if paid or address_verified:

b)

if not paid and not address_verified:

c)

if paid and address_verified:

d)

if paid and not address_verified: