wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Tuples

Total questions: 8

Worksheet time: 3mins

Name
Class
Date
1.

(3,)*4 results into

a)

(3,3,3,3)

b)

3,3,3,3

c)

12

d)

(12)

2.

Select the odd one out

a)

Tuple

b)

String

c)

List

d)

Integer

3.

Which will not generate error if T=(10,20,30,40,50)?

a)

T[1]+=2

b)

T.append(2)

c)

TP=T+T

d)

T.sum()

4.

If T=(10) and you execute the statement TT=T*10, then what will be the output of len(TT)?

a)

0

b)

1

c)

10

d)

Error

5.

Which of the following is an incorrect way to create a tuple?

a)

T=(3)*2

b)

T=(1,2,)

c)

T=('A','B')

d)

T=tuple([1,2,3])

6.

If tup=(1,2,3,4,5), then what is the output of tup.index(5)?

a)

Error

b)

4

c)

5

7.

If T=("A"), then what is the type of A?

a)

tuple

b)

string

c)

int

d)

list

8.

If TP=(15,13,12,1,90), then what is the output of TP[2:3]?

a)

(12,)

b)

(12)

c)

12

d)

(12,1)