Programming Examples
Write a Python program to find the length of a dictionary.
Write a Python program to find the length of a dictionary.
If input is: {“England”: “London”, “Italy”: “Rome”} then output should be: 2
If input is: {10: “ten”, 20: “twenty”, 30: “thirty”} then output should be: 3
If input is: {} then output should be: 0
Output/ Explanation: Input: {"England": "London", "Italy": "Rome"}
Output: Length of dictionary: 2
Input: {10: "ten", 20: "twenty", 30: "thirty"}
Output: Length of dictionary: 3