Search Header Logo
ETECH - Python: If-else & loops

ETECH - Python: If-else & loops

Assessment

Presentation

Computers

12th Grade

Practice Problem

Medium

Created by

Neil Christian Capanzana

Used 170+ times

FREE Resource

14 Slides • 10 Questions

1

media

2

media

3

media

4

media

5

media

6

media

7

media

8

media

9

media

10

media

11

media

12

media

13

media

14

Multiple Choice

Which statement allows the program to execute a block of code repeatedly as long as a certain condition is met?

1

if-else

2

while loop

3

for loop

4

none of the choices

15

Multiple Choice

What is the syntax for a while loop in Python?

1

for i in range()

2

while i in range()

3

while condition:

4

none of the choices

16

Multiple Choice

How many times will a while loop execute if the condition is initially false?

1

0

2

1

3

infinite

4

none of the choices

17

Multiple Choice

Which statement allows the program to execute a block of code repeatedly for a specific number of times?

1

if-else

2

while loop

3

for loop

4

none of the choices

18

Multiple Choice

What is the syntax for a for loop in Python?

1

for condition:

2

while i in range()

3

while condition:

4

none of the choices

19

Multiple Choice

How many times will a for loop execute if the condition is initially false?

1

0

2

1

3

infinite

4

none of the choices

20

Multiple Choice

What is the syntax for if-else in Python?

1

for condition:

2

if condition:

3

while condition:

4

none of the choices

21

Multiple Choice

What is the purpose of an if-else statement?

1

To execute a block of code repeatedly as long as a certain condition is met.

2

To execute a block of code repeatedly for a specific number of times

3

To make a decision based on a condition.

4

none of the choices

22

Multiple Choice

What is the syntax for an if-elif-else statement in Python?

1

if condition:

elif:

else:

2

if condition:

else:

elif:

3

if condition:

elif condition:

else:

4

none of the choices

23

Multiple Choice

How many times will an if-else statement execute?

1

0

2

1

3

infinite

4

none of the choices

24

media
media

Show answer

Auto Play

Slide 1 / 24

SLIDE