Q. What does the Python code: x = {1: ‘a’, 2: ‘b’}; print(x[1]) output?
Solution:
The code accesses the value associated with key 1 in the dictionary, which is ‘a’.
Get Question Bank
Strengthen Your Practice with our comprehensive question bank.
The code accesses the value associated with key 1 in the dictionary, which is ‘a’.
Strengthen Your Practice with our comprehensive question bank.