Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python Tuples

Total questions: 9

Worksheet time: 5mins

Name
Class
Date
1.

Tuples in Python are mutable

a)

False

b)

True

2.

How to create a single element tuple

a)

(1,)

b)

(1)

c)

{1}

d)

[1]

e)

tuple([1])

3.

Result of the program above is

a)

('1', '2', '3', '4', '5')

b)

(1, 2, 3, 4, 5)

c)

12345

d)

"12345"

4.

What is the output of the program above

a)

<class 'tuple'>

b)

<class 'None'>

c)

<class 'list'>

d)

<class 'int'>

5.

What is the output of the code above

a)

(1, '2', 3, 4, 5)

b)

syntax error

c)

(1, 2, 3, 4, 5)

d)

('1', '2', '3', '4', '5')

6.

Which of the following is true

a)

a is assigned a value of 1

b)

b is assigned a value of [2,3]

c)

b is assigned a value of (2,3)

d)

b is assigned a value of 2

7.

What is the output of the program above ?

a)

b is bigger

b)

a is bigger

c)

Syntax error : tuples can't be compared

8.

What is the output of the code above ?

a)

1 4

b)

1

c)

1 None

d)

1 [2,3,4]

e)

1 (2,3,4)

9.

What is the output of the program above ?

a)

True

b)

False