Loading...
Loading...
Test your knowledge of data collections
1. What index does the first item in a list have?
2. What does [1, 2, 3, 4, 5][-1] return?
3. What does [1, 2, 3, 4, 5][1:3] return?
4. Which method adds an item to the end of a list?
5. What's the result of [3, 1, 2].sort()?
6. Which of these creates a dictionary?
7. What does {"a": 1}.get("b") return?
8. How do you access the value for key "name" in a dict?
9. What does len(["a", "b", "c"]) return?
10. What does [1, 2, 3, 4, 5][::-1] return?