Which of the following can added a list of elements to a list?
a) add()
b) append()
c) extend()
d) None of the
a) add()
b) append()
c) extend()
d) None of the
Multiple Choice Question For List Manipulation Class 11 Computer Science (CS), Informatics Practices (IP)
1. List can contain values of these types:
(a) integers
(b) floats
(c) lists
(d) tuples
(e) all of these
2. Which of the following will create an empty list?
(a) L = [ ]
(b) L = list(0)
(c) L = list()
(d) L = List(empty)
3. Which of the following will return the last element of a list L with 5 elements ?
(a) L[5]
(b) L[4]
(c) L[-1]
(d) L[6]
4. If L = [1, 2] then L*2 will yield
(a) [1, 2] * 2
(b) [1, 2, 2]
(c) [1, 1, 2, 2]
(d) [1, 2, 1, 2)
5. If L1 = [1, 3, 5] and L2 = [2, 4, 6] then L1 + L2 will yield
(a) [1, 2, 3, 4, 5, 6]
(b) [1, 3, 5, 2, 4, 6]
(c) [3, 7, 11]
(d) [1, 3, 5, [2, 4, 6]]
6. Given a list L = [10, 20, 30, 40, 50, 60, 70], what would L[1:4] return?
(a) [10, 20, 30, 40]
(b) [20, 30, 40, 50]
(c) [20, 30, 40]
(d) [30, 40, 50]
7. Given a list L = [10, 20, 30, 40, 50, 60, 70], what would L[2: -2] return?
(a) [10, 20, 30, 40]
(b) [20, 30, 40, 50]
(c) [20, 30, 40]
(d) [30, 40, 50]
8. Given a list L = [10, 20, 30, 40, 50, 60, 70], what would L[-4-:1] return?
(a) [20, 30, 40]
(b) [30, 40, 50]
(c) [40, 50, 60]
(d) [50, 60, 70]
9. Given a list L = [10, 20, 30, 40, 50, 60, 70], what would L[-3: 99] return?
(a) [20, 30, 40]
(b) [30, 40, 50]
(c) [40, 50, 60]
(d) [50, 60, 70]
10. To find the last element of list namely ‘smiles’ in Python, _____ will be used.
(a) smiles[0]
(b) smiles[-1]
(c) smiles[lpos]
(d) smiles[:-1]
11. Out of the following what is correct syntax to copy one list into another ?
(a) listA = listB[]
(b) listA = listB[:]
(c) listA = listB[ ]()
(d) listA = list(listB)
12. What is printed by the Python code ?
print (list (range(3)))
(a) [0. 1, 2, 3]
(b) [1, 2, 3]
(c) [0, 1, 2]
(d) 0, 1, 2
13. Which of the following commands will create a list ?
(a) list1 = list()
(b) list1 = [ ]
(c) list1 = list([1, 2, 3])
(d) all of these
14. What is the output when we execute list("hello") ?
(a) ('h', 'e', ‘l’, ‘1’, 'o'),
(b) ['hello'].
(c) [‘llo’]
(d) ['olleh'].
15. What gets printed?
names = ["Hasan", "Balwant”, ‘Sean’, ‘Dia']
print(names[-1][-1])
(a) H
(b) n
(c) Hasan
(d) Dia
(e) a
16. What is the output of the following
l = [None] * 10
print(len(l))
(a) 10
(b) 0
(c) Syntax Error
(d) None
17. Which of the following is a standard Python library function and not an exclusively list function?
(a) append()
(b) remove()
(c) pop()
(d) len()
18. Which of the following can add only one value to a list?
(a) add()
(b) append()
(c) extend()
(d) none of these
19. Which of the following can add a list of elements to a list ?
(a) add()
(b) append()
(c) extend()
(d) none of these
20. Which of the following will always return a list?
(a) max()
(b) min()
(c) sort()
(d) sorted()
21. Which of the following can delete an element from a list if the index of the element is given?
(a) pop()
(b) remove()
(c) del
(d) all of these
22. Which of the following can delete an element from a list, if its value is given?
(a) pop()
(b) remove()
(c) del
(d) all of these
23. Which of the following searches for an element in a list and returns its index?
(a) search()
(b) find())
(c) index()
(d) lsearch()
24. Which of the following can copy a list another list?
(a) list()
(b) new()
(c) copy()
(d) = operato