Search Header Logo
If statment python

If statment python

Assessment

Presentation

Computers

10th Grade

Practice Problem

Hard

Created by

KANGNI AMOUZOUGAN

Used 1+ times

FREE Resource

21 Slides • 13 Questions

1

media

2

media

3

media

4

media

5

media

6

Fill in the Blanks

Type answer...

7

Open Ended

Explain how an 'if statement' allows a program to behave differently depending on circumstances.

8

media

9

media

10

Open Ended

Describe a scenario where using an 'if statement' would be necessary in a program.

11

Multiple Select

Which of the following are true about 'if statements'?

1

They allow programs to make decisions

2

They execute code only when a condition is true

3

They always execute all instructions

4

They can be used to handle user input

12

media

13

media

14

Multiple Choice

Which part of an if statement must evaluate to a boolean value?

1

The condition

2

The body

3

The indentation

4

The statement name

15

media

16

Open Ended

What will happen if the condition in an if statement is False?

17

media

18

Fill in the Blanks

19

media

20

Multiple Select

Select all statements that correctly describe the body of an if statement.

1

It is executed if the condition is True.

2

It must be indented by one level.

3

It is called the body.

4

It is always executed regardless of the condition.

21

media

22

Multiple Choice

Which of the following is a valid example of an if statement in Python?

1

if True: ... do something ...

2

if 5: ... do something ...

3

if "hello": ... do something ...

4

if = True: ... do something ...

23

media

24

media

25

media

26

Open Ended

Compare the use of 'if has_dog:' in image 1 and image 2. How does adding an 'else' clause change the behavior of the code?

27

media

28

Fill in the Blanks

Type answer...

29

media

30

media

31

Open Ended

Why is indentation important in Python when writing if-else statements?

32

Multiple Choice

Which of the following statements about indentation in Python if-else statements is correct?

1

Indentation is optional in Python.

2

Both 'if' and 'else' blocks must be indented by one level.

3

Only the 'if' block needs to be indented.

4

Indentation is required only for 'else' blocks.

33

media

34

media
media

Show answer

Auto Play

Slide 1 / 34

SLIDE