List Quiz
Python List Quiz Python List - 15 MCQ Quiz 1. Which of the following is a valid way to create a list in Python? list = (1,2,3) list = [1,2,3] list = {1,2,3} list = 2. Lists in Python are ____. Immutable Mutable Constant Fixed 3. Which function is used to find the length of a list? count() len() size() length() 4. What is the index of the first element in a Python list? 0 1 -1 None 5. What will be the output of len([10, 20, 30, 40]) ? 3 4 5 Error 6. What method adds an element to the end of a list? append() add() insert() extend() 7. Which method removes the last element from a list? remove() delete() pop() discard() 8. What is the output of [1,2,3] + [4,5] ? [1,2,3,4,5] [5,7,8] [1,2,3][4,5] Error 9. How can you access the last element of a list named my_list ? my_list[-1] my_list[last] my_list[len] my_list[end] 10. What does my_list.clear() do? Deletes the list v...