You are iterating over cost as well. Try this:

#level one of the dictionary
for drink, data in MENU.items():
    #this should print the drinks and cost
    print(drink, data["cost"])
    #this should print the ingredients   
    for ingredient in data["ingredients"].items():
        print(ingredient)
Answer from Bharel on Stack Overflow
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ three-level-nested-dictionary-python
Three Level Nested Dictionary Python - GeeksforGeeks
July 23, 2025 - In Python, a dictionary is a collection of key-value pairs, and it can contain other dictionaries as values. When you have a dictionary within another dictionary, and then another dictionary within the inner dictionary, you have a 3-level nested ...
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ define-a-3-level-nested-dictionary-in-python
Define a 3 Level Nested Dictionary in Python - GeeksforGeeks
July 23, 2025 - In this article we studied about creating a 3-level nested dictionary in Python using various methods. The choice of method depends on the specific requirements of your program, such as the need for dynamic creation, readability, or flexibility.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ how-to-loop-three-level-nested-python-dictionary
How to Loop Three Level Nested Python Dictionary - GeeksforGeeks
July 23, 2025 - In this approach, we are using nested for loops to iterate through each level of the 3-level nested dictionary. The outermost loop (for key1, value1 in dict.items()) iterates over the first level, the middle loop (for key2, value2 in value1.items()) iterates over the second level, and the innermost loop (for key3, value3 in value2.items()) iterates over the third level.
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ python_dictionaries_nested.asp
Python - Nested Dictionaries
Python Examples Python Compiler Python Exercises Python Quiz Python Challenges Python Practice Problems Python Server Python Syllabus Python Study Plan Python Interview Q&A Python Training ... A dictionary can contain dictionaries, this is called nested dictionaries.
๐ŸŒ
Stack Overflow
stackoverflow.com โ€บ questions โ€บ 34929399 โ€บ python-sorting-3-levels-nested-dictionaries
dictionary - python: sorting 3 levels nested dictionaries - Stack Overflow
May 17, 2017 - >>> from collections import OrderedDict >>> data = {'modID1': {'sequences2':{'header2':5}, 'sequences1':{'header1': 3}, ... 'sequences3':{'header3':1}}, ... 'modID2': {'sequences2':{'header2':8},'sequences1':{'header1': 1}}} >>> {k: OrderedDict(sorted(v.items(), key=lambda x: -sum(x[1].values()))) ... for k, v in data.items()} {'modID1': OrderedDict([('sequences2', {'header2': 5}), ('sequences1', {'header1': 3}), ('sequences3', {'header3': 1})]), 'modID2': OrderedDict([('sequences2', {'header2': 8}), ('sequences1', {'header1': 1})])} ... Find the answer to your question by asking. Ask question ... See similar questions with these tags. ... New site design and philosophy for Stack Overflow: Starting February 24, 2026... 601 Access an arbitrary element in a dictionary in Python
๐ŸŒ
Readthedocs
nested-dict.readthedocs.io
nested_dict โ€” nested_dict 1.61 documentation
You can use the nested_dict.update(other) method to merge in the contents of another dictionary. If the nested_dict has a fixed nesting and a value type, then key / value pairs will be overridden from the other dict like in Pythonโ€™s standard library dict. Otherwise they will be preserved as far as possible. For example, given a three-level nested nested_dict of int: >>> d1 = nested_dict.nested_dict(3, int) >>> d1[1][2][3] = 4 >>> d1[1][2][4] = 5 >>> # integers have a default value of zero >>> default_value = d1[1][2][5] >>> print (default_value) 0 >>> print (d1.to_dict()) {1: {2: {3: 4, 4: 5, 5:0}}}
๐ŸŒ
PyPI
pypi.org โ€บ project โ€บ nested_dict
nested_dict ยท PyPI
nested_dict extends defaultdict to support python dict with multiple levels of nested-ness: >>> from nested_dict import nested_dict >>> nd= nested_dict() >>> nd["one"] = "1" >>> nd[1]["two"] = "1 / 2" >>> nd["uno"][2]["three"] = "1 / 2 / 3" >>> ... for keys_as_tuple, value in nd.items_flat(): ... print ("%-20s == %r" % (keys_as_tuple, value)) ... ('one',) == '1' (1, 'two') == '1 / 2' ('uno', 2, 'three') == '1 / 2 / 3' If you want the nested dictionary to hold ยท
Find elsewhere
๐ŸŒ
Medium
bond-kirill-alexandrovich.medium.com โ€บ nested-dictionaries-in-python-5a362e03ec6c
Nested dictionaries in Python. In this article I will show you what isโ€ฆ | by Kirill Bondarenko | Medium
June 24, 2020 - Standard Python dictionary โ€” is an associative array of data with structure key-value. All the keys are unique and immutable (strings, numbers, characters), value may be any type.
๐ŸŒ
AlgoMaster
algomaster.io โ€บ home โ€บ python โ€บ nested dictionaries
Nested Dictionaries | Python | AlgoMaster.io
June 6, 2026 - Inside, it's a whole dictionary with its own rules. Nesting can go arbitrarily deep. The same access pattern keeps stacking brackets: Three brackets, three levels deep. The shape comes up constantly with JSON data, REST API responses, configuration files, and anywhere the world has a "thing inside a thing" structure. JSON objects map directly onto this representation in Python...
๐ŸŒ
SitePoint
sitepoint.com โ€บ python hub โ€บ nested dictionaries
Python - Nested Dictionaries | SitePoint โ€” SitePoint
A good rule of thumb is to keep nesting to a maximum of three or four levels deep. ... When working with real-world data, you'll often need to transform simple dictionaries into more complex nested structures.
๐ŸŒ
Learn By Example
learnbyexample.org โ€บ python-nested-dictionary
Python Nested Dictionary - Learn By Example
June 20, 2024 - You can access elements within a nested dictionary by specifying multiple keys in a chain, using square brackets []. Each key represents a level of nesting.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ define-a-nested-dictionary-in-python
Define a Nested Dictionary in Python - GeeksforGeeks
February 13, 2024 - In Python, dictionaries provide a versatile way to store and organize data. Nested dictionaries, in particular, allow for the creation of multi-level structures. In this article, we'll explore the process of defining a 3-level nested dictionary and demonstrate various methods to achieve this.
๐ŸŒ
Medium
medium.com โ€บ @ryan_forrester_ โ€บ python-nested-dictionaries-complete-guide-8a61b88a2e02
Python Nested Dictionaries: Complete Guide | by ryan | Medium
October 24, 2024 - A nested dictionary is simply a dictionary that contains other dictionaries as values. Hereโ€™s a basic example: employee = { 'name': 'Sarah Chen', 'position': { 'title': 'Senior Developer', 'department': 'Engineering', 'details': { 'level': ...
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python-nested-dictionary
Python Nested Dictionary - GeeksforGeeks
June 10, 2023 - A nested dictionary in Python is a dictionary that contains another dictionary (or dictionaries) as its value. Updating a nested dictionary involves modifying its structure or content by:Adding new key-value pairs to any level of the nested structure.Modifying existing values associated with specifi
๐ŸŒ
Programiz
programiz.com โ€บ python-programming โ€บ nested-dictionary
Python Nested Dictionary (With Examples)
In the above program, we create an empty dictionary 3 inside the dictionary people.
๐ŸŒ
Towards Data Science
towardsdatascience.com โ€บ home โ€บ latest โ€บ nested dictionary python - a complete guide to python nested dictionaries
Nested Dictionary Python - A Complete Guide to Python Nested Dictionaries | Towards Data Science
January 22, 2025 - Today you'll learn what is a nested dictionary, why to use nested dictionaries in Python, how to loop through a nested dictionary in Python, and much more.