Instructions
- 1. Your final score will reflect your grasp of the concepts—approach each question with precision.
- 2. Thoroughly review each solution before proceeding to ensure full understanding.
- 3. Final results will be available after submission to provide insights into areas for further improvement.
- 4. Maintain academic integrity—plagiarism undermines learning and professional growth.
- 5. Once submitted, responses are final, so ensure you’re confident in your answers.
- 6. These challenges are designed to test practical knowledge; apply your skills as you would in real-world scenarios.
All Problems
Question
Action
How do you access the value of 'x' in the nested dictionary { 'a': { 'b': { 'x': 5 } } }?
What will d.get('x', 0) return if 'x' is not in d?
How can you merge two dictionaries d1 and d2 in Python 3.9+?
What will the following code print?
Which method removes a key-value pair from a dictionary?
How do you check if a key exists in a dictionary?
What does dict.items() return?
Can a dictionary have duplicate keys?
Which of the following is a valid way to create an empty dictionary?
How do you update an existing dictionary with another?
How do you access the value of 'x' in the nested dictionary { 'a': { 'b': { 'x': 5 } } }?
What will d.get('x', 0) return if 'x' is not in d?
How can you merge two dictionaries d1 and d2 in Python 3.9+?
What will the following code print?
d = {'a': 1, 'b': 2} print(d.keys())