List in python: 20 MCQs
All 20 multiple-choice questions from this kit, free and with no sign-up.
Warm-up · 12 questions
Q1. Which of the following correctly creates a list in Python?
BeginnerAnswers and explanations are in the Veda app.
Q2. What is the index of the first element in a Python list?
BeginnerAnswers and explanations are in the Veda app.
Q3. Given `my_list = [10, 20, 30, 40]`, what does `my_list[-1]` return?
BeginnerAnswers and explanations are in the Veda app.
Q4. What is the result of `len([1, 2, 3, 4])`?
BeginnerAnswers and explanations are in the Veda app.
Q5. Which method adds an element to the end of a list?
BeginnerAnswers and explanations are in the Veda app.
Q6. What does `[1, 2, 3] + [4, 5]` produce?
BeginnerAnswers and explanations are in the Veda app.
Q7. What is the output of `[1, 2, 3] * 2`?
BeginnerAnswers and explanations are in the Veda app.
Q8. Lists in Python are immutable.
BeginnerAnswers and explanations are in the Veda app.
Q9. The index `-1` always refers to the last element of a list.
BeginnerAnswers and explanations are in the Veda app.
Q10. You can use the `+` operator to concatenate two lists.
BeginnerAnswers and explanations are in the Veda app.
Q11. The method used to add an element to the end of a list is ___.
BeginnerAnswers and explanations are in the Veda app.
Q12. To find the number of elements in a list, use the ___ function.
BeginnerAnswers and explanations are in the Veda app.
Building up · 8 questions
Q13. Which of the following checks if 5 is in a list `nums`?
IntermediateAnswers and explanations are in the Veda app.
Q14. What does `[10, 20, 30, 40, 50][1:4]` return?
IntermediateAnswers and explanations are in the Veda app.
Q15. What is the result of `[1, 2, 3].pop()`?
IntermediateAnswers and explanations are in the Veda app.
Q16. Which of the following removes the first occurrence of a value from a list?
IntermediateAnswers and explanations are in the Veda app.
Q17. What is the output of `[x*2 for x in [1, 2, 3]]`?
IntermediateAnswers and explanations are in the Veda app.
Q18. The `insert()` method adds an element to the end of a list.
IntermediateAnswers and explanations are in the Veda app.
Q19. Slicing a list always returns a new list.
IntermediateAnswers and explanations are in the Veda app.
Q20. A list can contain elements of different data types; this property is called ___.
IntermediateAnswers and explanations are in the Veda app.
Your notes can be a kit like these
Every kit here was made from real study material. Point Veda at a chapter, a PDF, a photo or a link and get notes, flashcards, practice MCQs, games and a scored test — free to start, in more than 40 languages.
- Chapter notes
- Flashcards
- Practice MCQs
- Scored tests
- Paper Solver
Get Veda free See what students get
Free to start · Android app and web · More than 40 languages