{"id":5263,"date":"2021-05-07T11:14:13","date_gmt":"2021-05-07T05:44:13","guid":{"rendered":"https:\/\/python-programs.com\/?p=5263"},"modified":"2021-11-22T18:42:54","modified_gmt":"2021-11-22T13:12:54","slug":"python-iterate-loop-over-all-nested-dictionary-values","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-iterate-loop-over-all-nested-dictionary-values\/","title":{"rendered":"Python: Iterate\/Loop over all Nested Dictionary values"},"content":{"rendered":"

Dictionaries are Python\u2019s implementation of an associative list, which\u00a0may be a\u00a0<\/span>arrangement\u00a0<\/span>. A dictionary\u00a0may be a\u00a0<\/span>collection of key-value pairs that are stored together. A key and its value are represented by each key-value pair.<\/p>\n

To an infinite depth, a dictionary may include another dictionary, which can contain dictionaries, and so on. This is referred to as a nested dictionary.<\/p>\n

Nested dictionaries are\u00a0one among\u00a0<\/span>several ways\u00a0during which\u00a0<\/span>structured information is represented (similar to records or structures in other languages).<\/p>\n

Examples:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

nesteddict = {\r\n'hello': {'www': 100, 'yyy': 'Helloworld'},\r\n'this': {'www': 'vikram', 'age': 20, 'DOB': 'FEB'},\r\n'BTechGeeks': {'PLACE': 'HYDERABAD', 'PINCODE': 500000,\r\n'PYTHON': {'FUNCTIONS': 'Built in', 'year': 1999}},\r\n}<\/pre>\n

Output:<\/strong><\/p>\n

100\r\nHelloworld\r\nvikram\r\n20\r\nFEB\r\nHYDERABAD\r\n500000\r\nBuilt in\r\n1999<\/pre>\n

Traverse over all Nested Dictionary<\/h2>\n