IP Class 11 MCQ Chapter 4 List and Dictionaries

  1. Which of the following is NOT true about List?
    a. List is value mutable
    b. List can store heterogeneous items
    c. List is size immutable
    d. List is ordered collection of items

Show Answer

c. List is size immutable

  1. Select correct statement
    i. Duplicate items are not allowed to store in List
    ii. We can use both index and negative index of list items to access it.

    a. i true, ii false
    b. i false, ii true
    c. both are true
    d. both are false

Show Answer

b. i false, ii true

  1. To find the total no of elements in list we can use ________ method.
    a. length()
    b. len()
    c. count()
    d. find()

Show Answer

b. len()

  1. to remove an item from list we can use
    a. pop()
    b. remove()
    c. del()
    d. both a and b
    e. all of the above

Show Answer

e. all of the above

  1. What will be output of given code?
    L =[23,34,45,12,32]
    Print(L[-3])

    a. 45
    b. 34
    c. Error
    d. 12

Show Answer

a. 45

  1. Predict the output of
    L = [‘s’,’a’,’n’,’j’]
    print(L[4])

    a. s
    b. j
    c. index error
    d. sanj

Show Answer

c. index error

  1. display the output of given code:
    L = [3,5,2]
    print(L*2)

    a. [ 6, 10, 4]
    b. [3, 5, 2, 3, 5, 2]
    c. [9, 25, 4]
    d. None

Show Answer

b. [3, 5, 2, 3, 5, 2]

  1. _________ method adds a new item/list as a single element at the end of list
    a. extend()
    b. append()
    c. insert()
    d. list()

Show Answer

b. append()

  1. _________ method add an element at a particular index in the list.
    a. extend()
    b. append()
    c. insert()
    d. list()

Show Answer

c. insert()

  1. to delete an element using its index no we can use
    a. pop()
    b. remove()
    c. delete()
    d. find()

Show Answer

a. pop()

  1. to delete an element using its value _________ can be used.
    a. pop()
    b. remove()
    c. del()
    d. list()

Show Answer

b. remove()

  1. _______ method adds each element of list passed as argument at the end of the given list.
    a. extend()
    b. append()
    c. insert()
    d. list()

Show Answer

a. extend()

  1. Select the correct statement to display the last element of list ‘L’?
    a. L[-1]
    b. L[len(L)-1]
    c. L[len(L)]
    d. Both a and b
    e. Both a and c

Show Answer

d. Both a and b

  1. Select the correct statement to display the first element of list ‘L’?
    a. L[0]
    b. L[1]
    c. L[-len(L)]
    d. L[-len(L)-1]

Show Answer

a. L[0]
c. L[-len(L)]

  1. Which of the following is correct code to display largest element of list ‘L’?
    a. L.sort()
    print(L[-1])
    b. L.sort(reverse = True)
    print(L[0])
    c. max(L)
    d. All of the above

Show Answer

d. All of the above

  1. Which of the following is correct code to display second largest element of list ‘L’?
    a. L.sort()
    print(L[-1])
    b. L.sort(reverse = True)
    print(L[1])
    c. print(sorted(L)[-1])
    d. All of the above

Show Answer

d. All of the above

  1. Look at the following code and state which type of list operation it carries out?
    list = [‘t’,’e’,’c’,’h’,’t’,’i’,’p’,’n’,’o’,’n’,’w’]
    for x in list:
    print(x)

    a. Repeating List
    b. Traversing List
    c. Slicing list
    d. Joining list          

Show Answer

a. It doesn’t care of data type of variable being declared.

  1. Look at the following code and state which type of list operation is being carried out?

    list = [‘t’,’e’,’c’,’h’,’t’,’i’,’p’,’n’,’o’,’n’,’w’]
    L = list*3
    print(L)

    a. Repeating List
    b. Traversing List
    c. Slicing list
    d. Joining list

Show Answer

a. Repeating List

  1. Look at the following code and state which type of list operation is being carried out?

    list = [‘t’,’e’,’c’,’h’,’t’,’i’,’p’,’n’,’o’,’n’,’w’]
    Print(L[2:8:2])

    a. Repeating List
    b.Traversing List
    c. Slicing list
    d. Joining list

Show Answer

c. Slicing list

  1. Predict the output:
    L = [4,5,8,2,1,9]
    L.pop(4)
    print(L)

    a. [4,5,8,1,9]
    b. [4,5,8,2]
    c. [4,5,8,2,9]
    d. [5,8,2,1,9]

Show Answer

c. [4,5,8,2,9]

  1. Predict the output:
    L = [4,5,8,2,1,9]
    L.remove(4)
    print(L)

    a. [4,5,8,1,9]
    b. [4,5,8,2]
    c. [4,5,8,2,9]
    d. [5,8,2,1,9]

Show Answer

d. [5,8,2,1,9]

  1. Find the output of given code?
    List1 = [2,3,4,5]
    List2 = [6,7,8]
    List1.extend(List2)
    Print(List1)

    a. [2,3,4,5,[6,7,8]]
    b. [[2,3,4,5],6,7,8]
    c. [2,3,4,5,6,7,8]
    d. [[2,3,4,5],[6,7,8]]

Show Answer

c. [2,3,4,5,6,7,8]

  1. Find the output of given code?
    List1 = [2,3,4,5]
    List2 = [6,7,8]
    List1.append(List2)
    Print(List1)

    a. [2,3,4,5,[6,7,8]]
    b. [[2,3,4,5],6,7,8]
    c. [2,3,4,5,6,7,8]
    d. [[2,3,4,5],[6,7,8]]

Show Answer

a. [2,3,4,5,[6,7,8]]

  1. What will be output of following code?
    list1 = [3,4,6,4,7, 8]
    list1.remove(4)
    print(list1)

    a. [3,4,6,4,8]
    b. [3,6,4,7,8]
    c. [3,6,7,8]
    d. 3,4,6,7,8]

Show Answer

b. [3,6,4,7,8]

  1. Raju has created following list:
    list1  = [2,5,6,7]
    Now he wants to add 12 at the end of list1. Help him to write correct code for it

    a. list1.insert(len(list1), 12)
    b. list1.append(12)
    c. list1.extend([12])
    d. All are correct

Show Answer

d. All are correct

Leave a Comment

Your email address will not be published. Required fields are marked *

error: Content is protected !!