wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python-Expressions#1

Total questions: 10

Worksheet time: 7mins

Name
Class
Date
1.

Which of the following is a proper arithmetic expression in Python?

a)

10 (15 + 6)

b)

(10 * 2) (4 + 8)

c)

5 * (6 - 2)

2.

Which of the following are valid assignment statements in which only variable k has already assigned a value?

a)

n = k + 1

b)

n = n + 1

c)

n + k = 10

d)

n + 1 = 1

3.

What does the following expression evaluates to ?

2 + 9 * ((3 * 12) - 8) / 10

a)

27

b)

27.2

c)

28

d)

30.8

4.

Evaluate the following expression in Python

2 * 3 ** 2

a)

18

b)

36

c)

12

5.

Evaluate the following expression in Python?

24 // 4 // 4

a)

1

b)

2

c)

24

d)

1.5

6.

Evaluate the following arithmetic expression in Python ?

2 ** 2 ** 3

a)

256

b)

48

c)

64

d)

512

7.

Evaluate the following expression in Python?

2 + int(4.5)

a)

6

b)

6.5

c)

7

d)

Error

8.

What is the exact result of the following expresssion in Python?

25 // 10.0

a)

2.0

b)

2

c)

3

d)

3.0

9.

Evaluate the following expression in python?

-10 % 3 / 2

a)

1

b)

-1

c)

0.5

d)

-0.5

10.

Which of the following are valid identifiers in Python?

a) errors b) error_count c) error-count

a)

a

b)

b

c)

c