0% 0 Get ready, set, go Time ended Quiz on Python List This is a comprehensive MCQ quiz on Python Lists 1 / 15 1. What will be printed with the following python code ? print(list(range(3))) A) [1,2,3] B) [0,1,2,3] C) [0,1,2] D) 0,1,2 2 / 15 2. A python list can contain values of these types: A) float B) string C) any data type out of float, integer, string D) integer 3 / 15 3. Which one of the following will always return a list? A) max() B) sort() C) sorted() D) reverse() 4 / 15 4. Which of the following will create an empty list? A) L=List(empty) B) L=list(0) C) L=[list] D) L=[ ] 5 / 15 5. Assume a list: letters=['a','b','o','c','p'], What would be displayed in a Python shell for the given expression? >>>letters[2:5:2] A) ['b','c'] B) ['o','c','p'] C) ['a','o'] D) ['o','p'] 6 / 15 6. Given a list L=[10,20,30,40,50,60,70], what would L[2:-2] return? A) [20,30,40,50] B) [20,30,40] C) [30,40,50] D) [40,50,60] 7 / 15 7. Given a list L=[10,20,30,40,50,60], what would L[1:4] return? A) [10,20,30,40] B) [20,30,40,50] C) [30,40,50] D) [20,30,40] 8 / 15 8. Which of the following can delete an element from a list, if its value is given? A) delval() B) drop() C) delete() D) remove() 9 / 15 9. Given a list of letters, L=['a','e','o','u'], select the correct statement to add one more item, 'i' after 'e' in the list. A) L.extend(3,'i') B) L.insert(3,'i') C) L.append(2,'i') D) L.insert(2,'i') 10 / 15 10. Given a list L=[10,20,30,40,50,60,70], what would L[-4:-1] return? A) [40,50,60] B) [30,40,50] C) [20,30,40] D) [50,60,70] 11 / 15 11. Which of the following function can add only one element to a list ? A) add() B) addone() C) extend() D) append() 12 / 15 12. A list L has 5 items. Which one of the following statements will return the last element of the list? A) L[-1] B) L[5] C) L[6] D) L[4] 13 / 15 13. Which of the following can add multiple elements to a list? A) addmany() B) add() C) append() D) extend() 14 / 15 14. If L1=[1,3,5] and L2=[2,4,6] then L1+L2 will yield A) [1,3,5,[2,4,6]] B) [1,2,3,4,5,6] C) [3,7,11] D) [1,3,5,2,4,6] 15 / 15 15. Given a list L=[10,20,30,40,50,60,70], what would L[-3:99] return? A) [50,60,70] B) [20,30,40] C) [30,40,50] D) [40,50,60] Your score is The average score is 0%Share this quiz with your friends, LinkedIn Facebook Twitter 0% Restart quiz Rate the quiz Send feedback Post navigation Quiz on Python Dictionary Quiz on Python Pandas Series (Class 12 IP)