← All topics
Quiz: Python Dictionaries: questions with answers
15 questions, each with the answer and a short explanation.
Take the timed quiz + get a certificate →- Q1. What does this print? (code)
- Q2. What does {"x": 1}.get("y", 0) return?
- Q3. Which CANNOT be a dictionary key?
- Q4. What does this print? (code)
- Q5. What does len({"a": 1, "a": 2}) return?
- Q6. What does this print? (code)
- Q7. What does this print? (code)
- Q8. What does this print? (code)
- Q9. What does this print? (code)
- Q10. What does this print? (code)
- Q11. What does this print? (code)
- Q12. What does d["z"] do if the key "z" is not in the dictionary d?
- Q13. What does this print? (code)
- Q14. What does this print? (code)
- Q15. What does this print? (code)