Search Header Logo
Conditionals in Python Lesson

Conditionals in Python Lesson

Assessment

Presentation

Computers

9th - 12th Grade

Practice Problem

Easy

Created by

Jason King

Used 4+ times

FREE Resource

14 Slides • 12 Questions

1

media

2

media

3

Multiple Choice

Which of the following best describes the purpose of relational operators in programming?

1

To compare the values of two expressions and return a true/false result.

2

To perform arithmetic calculations between numbers.

3

To store large amounts of data in memory.

4

To display information to the user.

4

media

5

Multiple Choice

Which relational operator is used to check if two values are not equal in Python?

1

==

2

!=

3

<

4

>=

6

Match

Match the following

Equal

Not Equal

Less Than

Greater Than

Less than or Equal

==

!=

<

>

<=

7

media

8

Multiple Choice

What will be the output of the following code? print(10 != 7)

1

True

2

False

3

None

4

Error

9

media

10

media

11

Multiple Select

Which of the following statements about if statements is/are correct?

1

If statements execute code only when a condition is True.

2

If statements always execute all code inside them regardless of the condition.

3

If statements can be used to control the flow of a program.

4

If statements are only used for mathematical calculations.

12

media

13

media

14

Multiple Choice

How many choices are possible when using a single if-else statement?
1
1
2
2
3
3
4
4

15

media

16

Multiple Choice

Which of the following best describes the purpose of an if-else statement in programming?

1

To repeat a block of code multiple times

2

To make decisions based on conditions

3

To store user input

4

To define a function

17

media

18

media

19

Drag and Drop

Question image
Complete the code to determine whether the number is positive negative or zero



conditionA: ​


conditionB: ​
Drag these tiles and drop them in the correct blank above
num != 0
num > 0
num < 0
num == 0
num = 0
num >= 0
num <= 0

20

media

21

Fill in the Blank

Fill in the blank: In Python, the logical operator ___ is used to check if both conditions are true.

22

media

23

Multiple Choice

Given the code: if temperature > 25 and is_raining == False: print("It's warm and dry – perfect weather for flying!") What will be printed if temperature is 28 and is_raining is False?

1

It's warm and dry – perfect weather for flying!

2

Nothing will be printed.

3

An error will occur.

4

It's raining, not perfect weather.

24

media

25

Multiple Select

Select all correct statements about the use of 'if', 'elif', and 'else' in conditional statements.

1

'if' is necessary to start a conditional statement.

2

You can have unlimited 'elif' statements in a block.

3

'else' is required in every conditional statement.

4

You can only have one 'if' and one 'else' in a block.

26

Multiple Choice

How do relational operators help in making decisions within conditional statements in programming?

1

They allow comparison of values to determine program flow.

2

They store large amounts of data.

3

They are used to create graphics.

4

They are only used for mathematical calculations.

media

Show answer

Auto Play

Slide 1 / 26

SLIDE