DrSchool Learn coding, fast.
EN AR BN CS DE EL Search

Maps / Dictionaries — Example 60

Quick explanation + ready code for: Maps / Dictionaries.

Python Maps / Dictionaries Back to examples
Back to language
Syntax: Maps / Dictionaries in Python. ID: #60

Code

d = {"a": 21, "b": 22}
print(list(d.keys()), d["a"])

Notes

You can copy this snippet and adapt it. For advanced, add real-world inputs, edge cases, and tests.