Get The Most Affordable Hosting in the World!
Starting at just $1.87/month, Vercaa offers unbeatable pricing for world-class web hosting services.
Fast, reliable, and secure hosting to power your website without breaking the bank. Plus, enjoy a free CDN for faster loading times worldwide!
Get Started Now!A Python dictionary is said to have a nested structure if value of one or more keys is another dictionary. A nested dictionary is usually employed to store a complex data structure.
The following code snippet represents a nested dictionary:
Example 1
You can also constitute a for loop to traverse nested dictionary, as in the previous section.
It will produce the following output −
Mahesh : {'Phy': 60, 'maths': 70} Madhavi : {'phy': 75, 'maths': 68} Mitchell : {'phy': 67, 'maths': 71}
Example 2
It is possible to access value from an inner dictionary with [] notation or get() method.
It will produce the following output −
68 60 71
The End! should you have any inquiries, we encourage you to reach out to the Vercaa Support Center without hesitation.