wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

python 3-5 unit 10gr

Total questions: 25

Worksheet time: 15mins

Name
Class
Date
1.

Which code means not equal to?

a)

==

b)

<=

c)

>

d)

!=

2.

Which of the following is NOT a Comparison Operator?

a)

<=

b)

==

c)

=

d)

!=

3.

Which of the following is NOT a Boolean Statement?

a)

name == "duck"

b)

8 <= 12

c)

num = int(Input("Pick a number.")

d)

total > 0

4.

Which booleans have a value of True?

a)

12 - 3 == 9

b)

30 <= 25

c)

17 != 11 + 6

d)

15 / 5 == 3.0

5.

Which of the following are valid values for a boolean in Python?

Select ALL that apply.

a)

True

b)

false

c)

0

d)

False

e)

1

6.

What is the final value for total?

a)

6

b)

4

c)

7

d)

9

7.

Which lines of code will be skipped when the program is run?

a)

4, 7, 8

b)

4

c)

3, 7, 8

d)

7, 8

8.

In the provided code, what is the final value for alarm?

a)

6

b)

7

c)

8

d)

9

9.

Review the provided code. Are there any possible flaws in this programming code.

a)

There are no flaws in the program

b)

A colon, : , is missing from the end of line 2

c)

The value for day could be spelled incorrectly.

d)

The value for day could be entered as a number.

10.

What is the truth value for the compound Boolean statement?

5 == 2 + 3 or 7 > 8

a)

True

b)

False

c)

No Value

11.

In the provided code, what is the final output?

a)

"Fred"

b)

15

c)

25

d)

35

12.
The second part of if, that is executed when the condition is false
a)
if
b)
else
c)
for
d)
input
13.
What will the lines of code print?
a)
A
b)
B C
c)
A B C
d)
A C
14.
What will the following lines of code print?
a)
A
b)
B C
c)
A C
d)
Nothing, it will return an error.
15.
Which statement will check to see if a is equal to b?
a)

if a equal b

b)
if a = b:
c)
if a != b:
d)
if a == b:
16.

What is the output?

a)

more than 7

b)

more than 23

c)

spam

d)

7

17.

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

a)

elif

b)

else

c)

ifif

d)

else if

18.

Data type that can only be true or false

a)

int

b)

string

c)

boolean

d)

float

19.
What symbol do you use to make a comment in Python?
a)
@
b)
¬
c)
;
d)
#
20.

What will be the output of the following code?

a)

Greater

b)

Smaller

c)

Error

d)

None

21.

Which python operator means 'less than or equal to'?

a)

>=

b)

>

c)

<

d)

<=

22.

What is the value of the expression 100 / 25?

a)

4

b)

4.0

c)

"4.0"

d)

'4.0'

23.

What is the output of the following code :


print 9//2

a)

4.5

b)

4.0

c)

4

d)

3

24.

What is the answer of this expression, 22 % 3 is?

a)

7

b)

1

c)

0

d)

5

25.

x = 4.5

y = 2

print(x//y)

a)

2.0

b)

2

c)

9

d)

9.0