AI engineering glossary · Python core
What is dictionary?
Dictionary (also called dict): A mutable collection of key-value pairs, written in curly braces with colons, where each unique key maps to a value. Lookup by key is very fast on average. Since Python 3.7 a dictionary remembers the order in which keys were inserted.
Dictionary: an example
student = {'name': 'Kiran', 'age': 22}; student['name'] gives 'Kiran'; student['city'] = 'Kochi' adds a new pair.
Related terms
More Python core terms
- Dictionary comprehension
- Docstring
- Dynamic typing
- enumerate
- Escape sequence
- Exception
- Exponentiation
- Expression
Where you learn it
Dictionary is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.