wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

[Python] Variables, Data Types, and Operators

Total questions: 11

Worksheet time: 6mins

Name
Class
Date
1.

What is the best data type for:

"THE NUMBER OF CUPS"

a)

String

b)

Integer

c)

Float

d)

Boolean

2.

What is the best data type for:

"THE NUMBER OF STUDENTS"

a)

String

b)

Integer

c)

Float

d)

Boolean

3.

What is the best data type for:

"THE TEMPERATURE IN CELSIUS"

a)

String

b)

Boolean

c)

Float

d)

Integer

4.

What is the best data type for:

"IS THE LIGHT ON?"

a)

String

b)

Boolean

c)

Integer

d)

Float

5.

Pick the correct variable name

a)

your_address

b)

your_phone#

c)

your address

d)

your phone

6.

Pick the correct variable name

a)

BIRTH YEAR1

b)

BIRTH1YEAR

c)

1BIRTHYEAR

d)

1_BIRTHYEAR

7.

What operation to be executed first in the Python expression below?

5 - 2 / 2 - -2 * 3

a)

/

b)
  • -(unary)

c)

-

d)

*

8.

What operation is to be executed LAST in the Python expression below?

2 ** 4 / -3 // 4 * 5

a)

**

b)

//

c)

/

d)

*

9.

Give the output of the code below:

print(2+4/2-1)

a)

2

b)

2.0

c)

3

d)

3.0

10.

Give the output of the code below:

print(30-2**3*3)

a)

21

b)

24

c)

8

d)

6

11.

What is the correct Python expression based on this formula for finding the area of a trapezoid?

a)

A = B + b / 2 * h

b)

A = (B + b) / (2 * h)

c)

A = B + b / (2 * h)

d)

A = (B + b) / 2 * h