wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

QUIZ1

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

What is the output of the following list assignment

aList = [4, 8, 12, 16]

aList[1:4] = [20, 24, 28]

print(aList)

a)

[4, 20, 24, 28, 8, 12, 16]

b)

[4, 20, 24, 28]

2.

What is the output of the following list operation

aList = [10, 20, 30, 40, 50, 60, 70, 80]

print(aList[2:5])

print(aList[:4])

print(aList[3:])

a)

[20, 30, 40, 50]

[10, 20, 30, 40]

[30, 40, 50, 60, 70, 80]

b)

[30, 40, 50]

[10, 20, 30, 40]

[40, 50, 60, 70, 80]

c)

None of these

3.

What is the output of the following

aList = [5, 10, 15, 25]

print(aList[::-2])

a)

[15, 10, 5]

b)

[10, 5]

c)

[25, 10]

4.

In Python, list is mutable

a)

False

b)

True

5.

Which of the following would give an error?

a)

list1=[]

b)

list1=[]*3

c)

list1=[2,8,7]

d)

None of the above

6.

Suppose list1 is [1, 3, 2], What is list1 * 2 ?

a)

[2, 6, 4].

b)

[1, 3, 2, 1, 3]

c)

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

d)

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

7.

___________ method adds one list at the end of another list.

a)

extend( )

b)

append( )

c)

insert( )

8.

____________function can be used to insert an element/object at a specified index.

a)

extend( )

b)

insert ( )

c)

append( )

9.

Is this the correct code for a list?

register = {"Sam", "Pheobe", Georgia", Richard"}

a)

Yes

b)

No

10.

To print a list called fruitList we use

a)

print(fruitList)

b)

list(print)

c)

fruitList.print()

d)

fruitList(print)