wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

list

Total questions: 7

Worksheet time: 4mins

Name
Class
Date
1.

What will be the output of following program:

list1 = ["python", "list", 1952, 2323, 432]

print(list1[1:4])

a)

["python","list",1952,2323]

b)

[1952,2323,432]

c)

["list",1952,2323]

d)

["list",1952,2323,432]

2.

What will be the output of following program:

list1 = ["python", "list", 1952, 2323, 432]

print(list1[-5])

a)

list

b)

1952

c)

432

d)

python

3.

What will be the output of following code-

a,b=[3,1,2],[5,4,6]

print(a+b)

a)

[3,1,2]+[5,4,6]

b)

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

c)

[3,1,2,5,4,6]

d)

[54,6,3,1,2]

4.

What will be the output of following code-

list1=[1, 3, 2]

list1 * 2

a)

[1,3,2][1,3,2]

b)

[1,3,2]*2

c)

[1,3,2,1,3,2]

d)

( [1,3,2] )([1,3,2])

5.

theList=[1, 2, [1.1, 2.2]]

print(len(theList))

a)

1

b)

2

c)

3

d)

4

6.

What will be the output of following program:

data = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]

print(data[1][0][0])

a)

2

b)

5

c)

1

d)

7

7.

What will be the output of following program:

a=[2,3]

a.append(7)

print(a))

a)

(2,3)

b)

[2,7]

c)

[2,3,7]

d)

[7,2,3]