Search Header Logo
Python Conditionals & While loop Review

Python Conditionals & While loop Review

Assessment

Presentation

Computers

8th - 10th Grade

Medium

Created by

Asma Al-Faran

Used 20+ times

FREE Resource

0 Slides • 31 Questions

1

Multiple Choice

‘If’ is a decision making statement

1

TRUE

2

FALSE

2

Multiple Choice

The second part of if, that is executed when the condition is false
1
if
2
else
3
for
4
input

3

Multiple Choice

Question image

What is the output?

1

more than 7

2

more than 23

3

spam

4

7

4

Multiple Choice

Which symbol means "not equal to"?

1

==

2

<=

3

>=

4

!=

5

Multiple Choice

If you want to test more than one condition (chained condition), what do you use after if statement?

1

elif

2

else

3

ifif

4

else if

6

Multiple Choice

Which character must be at the end of the line for if?

1

:

2

;

3

.

4

{

7

Multiple Choice

What symbol do you use to make a comment in Python?
1
@
2
¬
3
;
4
#

8

Multiple Choice

What does the = = symbol mean in Python?

1

Equal to or shows equality

2

Not Equal

3

Code that will be skipped

4

End of clause

9

Multiple Choice

What is the Python built-in function used to display numbers and text on the screen?

1

print

2

input

3

output

4

command

10

Multiple Choice

Question image
What will be printed to the screen?
1
Nothing
2
Success
3
Failure
4
Success
 Failure

11

Multiple Choice

Question image
What will be printed to the screen?
1
Success
2
Failure
3
Part of the way there!
4
Nothing

12

Multiple Choice

Question image
What will be printed to the screen?
1
Failure
2
Part of the way there!
3
Success
4
Nothing

13

Multiple Choice

Question image
What will be printed to the screen?
1
Nothing
2
Success
3
Part of the way there!
4
Failure

14

Multiple Choice

In programming, what is iteration?
1
The repetition of steps within a program
2
The order in which instructions are carried out
3
A decision point in a program
4
Testing a program to make sure it works

15

Multiple Choice

Which two statements are used to implement iteration?
1
IF and WHILE
2
ELSE and WHILE
3
FOR and WHILE
4
IF and ELSE

16

Multiple Choice

Which of the following symbols is used in Python to mean "Equal to"?
1
=
2
!=
3
==
4
>=

17

Multiple Choice

Which of the following symbols is used in Python to mean "Not equal to"?
1
==
2
!=
3
<>
4
><

18

Multiple Choice

Which of the following symbols is used in Python to mean "Greater than or equal to"?
1
<=
2
>>
3
>=
4
=>

19

Multiple Choice

Question image
1
5
4
3
2
1
2
4
3
2
1
0
3
5  4  3  2  1
4
4  3  2  1  0

20

Multiple Choice

Question image
1
5
4
3
2
1
2
5  4  3  2  1
3
4
3
2
1
0
4
4  3  2  1  0

21

Multiple Choice

Question image
1
10  8  6  4  2
2
10
8
6
4
2
3
2  4  6  8  10
4
10  9  8  7  6  5  4  3  2  1

22

Multiple Choice

Question image
1
12  9  6  3  0
2
0  3  6  9  12
3
9  6  3  0
4
0  3  6  9

23

Multiple Choice

Question image
1
12  17   22
2
5
3
12
4
5  10

24

Multiple Choice

Question image
1
Hello world!
2
Hello world
3
Hello world!
Hello world!
Hello world!
Hello world!
Hello world!
Hello world!
......(repeated continuously)
4
Error

25

Multiple Choice

Question image
1
Hello world!
Hello world!
Hello world!
Hello world!
Hello world!
Hello world!
(repeated continuously)
2
Hello world!
3
Hello world!
break              
4
Error

26

Multiple Choice

Question image
1
Welcome
2
Try again!
3
Error
4
Enter your password

27

Multiple Choice

Question image
Which of the following will print:
1
for i in range(1, 5):   
print(str(i) * 5)
2
for i in range(1, 5):   
print("i" * i)
3
for i in range(1, 6):   
print("i" * i)
4
for i in range(1, 6):   
print(str(i) * i)

28

Multiple Choice

Which of the following for loops would print the following numbers?

3

5

7

9

1

for i in range(3, 10, 2):

print(i)

2

for i in range(3, 9, 2):

print(i)

3

for i in range(9):

print(i)

4

for i in range(3,9):

print(i)

29

Multiple Choice

What would be the output of the following code:

for i in range(3):

print(5)

1

0 1 2

2

3 3 3 3 3

3

5 5 5

4

0 1 2 3 4

30

Multiple Choice

Question image

Which is correct?

1

A

2

B

31

Multiple Choice

x = 5

y = 6

print(x*y)


The code above displays the following:

1

11

2

x*y

3

Syntax Error

4

30

pattern-tertiary

‘If’ is a decision making statement

1

TRUE

2

FALSE

Show answer

Auto Play

Slide 1 / 31

MULTIPLE CHOICE