Python Data Structures

Assess your knowledge of lists,tuples,dictionaries,and sets.

1. Which Python data structure uses curly braces and stores key-value pairs?
2. Select all immutable data structures in Python.
3. Sets allow duplicate elements.
4. What is the built-in function to get the number of elements in a list?
5. Which method is used to remove and return the last element of a list?
6. Which of the following are valid ways to create an empty list?
7. What data structure is defined with square brackets `[]` and is mutable?
8. Dictionaries in Python 3.7+ preserve the insertion order of keys.
9. What data structure is used to store unique elements and is denoted by curly braces `{}`?
10. Which list methods modify the original list in-place (do not return a new list)?
11. Which operator checks if a key exists in a dictionary?
12. A tuple can be converted to a list using the `list()` function.
13. What method adds multiple elements to a set at once?
14. Which of the following are valid string methods in Python?
15. What is the output of `len((1, 2, 3, (4, 5)))`?
Answered 0 of 0 — 0 correct