Quiz
Multiple Choice Questions -Lists
Create a free account to finish this quiz
Save your progress and see your final score.
Already have an account? Sign in
Questions in this quiz (13)
1What is the output when we execute list(“hello”)?
- A[‘h’, ‘e’, ‘l’, ‘l’, ‘o’]
- B[‘hello’]
- C[‘llo’]
- D[‘olleh’]
2Suppose listExample is [‘h’,’e’,’l’,’l’,’o’], what is len(listExample)?
- A5
- B4
- Cnone
- Derror
3Suppose list1 is [2445,133,12454,123], what is max(list1)?
- A2445
- B133
- C12454
- D123
4Suppose list1 is [1, 5, 9], what is sum(list1)?
- A1
- B9
- C15
- Derror
5Suppose list1 is [2, 33, 222, 14, 25], What is list1[-1]?
- Aerror
- Bnone
- C25
- D2
6To add a new element to a list we use which command?
- Alist1.add(5)
- Blist1.append(5)
- Clist1.addLast(5)
- Dlist1.addEnd(5)
7Suppose list1 is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after list1.reverse()?
- A[3, 4, 5, 20, 5, 25, 1, 3]
- B[1, 3, 3, 4, 5, 5, 20, 25]
- C[25, 20, 5, 5, 4, 3, 3, 1]
- D[3, 1, 25, 5, 20, 5, 4, 3]
8Suppose listExample is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after listExample.extend([34, 5])?
- A[3, 4, 5, 20, 5, 25, 1, 3, 34, 5]
- B[1, 3, 3, 4, 5, 5, 20, 25, 34, 5]
- C[25, 20, 5, 5, 4, 3, 3, 1, 34, 5]
- D[1, 3, 4, 5, 20, 5, 25, 3, 34, 5]
9Suppose listExample is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after listExample.pop(1)?
- A[3, 4, 5, 20, 5, 25, 1, 3]
- B[1, 3, 3, 4, 5, 5, 20, 25]
- C[3, 5, 20, 5, 25, 1, 3]
- D[1, 3, 4, 5, 20, 5, 25]
10Suppose listExample is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after listExample.pop()?
- A[3, 4, 5, 20, 5, 25, 1]
- B[1, 3, 3, 4, 5, 5, 20, 25]
- C[3, 5, 20, 5, 25, 1, 3]
- D[1, 3, 4, 5, 20, 5, 25]
11What will be the output of the following Python code?
>>>list("a#b#c#d".split('#'))- A[‘a’, ‘b’, ‘c’, ‘d’]
- B[‘a b c d’]
- C[‘a#b#c#d’]
- D[‘abcd’]
12What will be the output of the following Python code?
list1 = [1, 2, 3, 4]
list2 = [5, 6, 7, 8]
print(len(list1 + list2))- A2
- B4
- C5
- D8
13To which of the following the “in” operator can be used to check if an item is in it?
- ALists
- BDictionary
- CSet
- DAll of the mentioned
Information
- Description
- Quiz on Multiple Choice Questions -Lists, created by Aparna Dhirde on 17/03/2020.
- Author
- Aparna Dhirde
- Language
- English
- Views
- 77
- History
- Created on 17 Mar 2020 · updated on 17 Mar 2020
- Tags
- Rating
- No ratings yet Rate this quiz