wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Lists - MCQ1

Total questions: 10

Worksheet time: 7mins

Name
Class
Date
1.

If L=[35,2,12,29,15]. then after L.pop(2), the contents of the list will be

a)

[35,12,29,15]

b)

[35,2,29,15]

c)

[35,2,12,29]

d)

None of the above

2.

If L=[35,2,12,29,15]. then after L.pop(), the contents of the list will be

a)

[35,12,29,15]

b)

[35,2,29,15]

c)

[35,2,12,29]

d)

None of the above

3.

If L=[10,20,30,50,60], which methods can add the number 40 between 30 and 50?

a)

L.append(40)

b)

L.extend(40)

c)

L.insert(3,40)

d)

L.insert(40,3)

4.

Which of these statements will delete the number 40 from the list L=[10,20,30,40,50,60,70]?

1) L.remove(40)

2) L.delete(40)

3) L.pop(3)

4)L.pop(4)

a)

1 and 2

b)

1 and 3

c)

1 and 4

d)

1 only

5.

If L=[10,20,30,40,50], then L.append(60) gives

a)

[10,20,30,40,50,60,70]

b)

[10,20,30,40,50,[60,70]]

c)

Error

d)

None of the above

6.

If L=[10,20,30,40,50,60,70], then which of these statements would delete the elements 40,50,and 60?

a)

L.delete([40,50,60])

b)

del L[40,50,60]

c)

del L[3:6]

d)

L.delete[3:6]

7.

In the following questions, a statement (A) of Assertion and another statement (R) of reasoning are given. Choose your answers as per the following

a) A and R are True and R is the right reasoning for the statement A

b) A and R are True, but R is not the correct reasoning for A

c) A is True, but R is False

d) A is False, but R is True


Statement

A) The values entered in a list can be edited later.

R) List is a data structure which can include values of multiple data types.

a)

a

b)

b

c)

c

d)

d

8.

In the following questions, a statement (A) of Assertion and another statement (R) of reasoning are given. Choose your answers as per the following

a) A and R are True and R is the right reasoning for the statement A

b) A and R are True, but R is not the correct reasoning for A

c) A is True, but R is False

d) A is False, but R is True


Statement

A) In the pop () method, the argument is optional..

R) If no argument is given, it removes the last element

a)

a

b)

b

c)

c

d)

d

9.

In the following questions, a statement (A) of Assertion and another statement (R) of reasoning are given. Choose your answers as per the following

a) A and R are True and R is the right reasoning for the statement A

b) A and R are True, but R is not the correct reasoning for A

c) A is True, but R is False

d) Both A and R are False


Statement

A) In the remove () method, the argument is optional..

R) If no argument is given, it removes the last element

a)

a

b)

b

c)

c

d)

d

10.

In the following questions, a statement (A) of Assertion and another statement (R) of reasoning are given. Choose your answers as per the following

a) A and R are True and R is the right reasoning for the statement A

b) A and R are True, but R is not the correct reasoning for A

c) A is True, but R is False

d) Both A and R are False


Statement

A) In a list, the last element has index -1

R) Lists do not support negative indexing

a)

a

b)

b

c)

c

d)

d