🍯 Dictionaries
Published Aug 4, 2021Updated Jun 8, 2023
Contribute to Docs
🍯, or dictionary or hash map in other languages, is an ordered set of value pairs:
🔤key🔤 ➡️ 🔤value🔤
It provides a way to map pieces of data to each other, and allows for quick access to values associated to keys. Keys must be unique in dictionaries, but the values don’t have to be.
Syntax
🏁 🍇🍿🔤fr🔤 ➡️ 🔤Salut!🔤🔤it🔤 ➡️ 🔤Ciao!🔤🔤de🔤 ➡️ 🔤Guten Tag!🔤🔤en🔤 ➡️ 🔤Hey!🔤🔤es🔤 ➡️ 🔤Hola!🔤🔤cn🔤 ➡️ 🔤你好!🔤🔤jp🔤 ➡️ 🔤こんにちは!🔤🍆 ➡️ dictionary🍉
🍿
is used to list key value pairs, where each key is separated from its value with a ➡️
. This will create an instance of 🍯
, which is stored into dictionary.
🍯
is implemented as a hash table and is O(1) on average and O(n) in worst case.
Contribute to Docs
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.
Learn Emojicode on Codecademy
- Career path
Computer Science
Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!Includes 6 CoursesWith Professional CertificationBeginner Friendly75 hours - Free course
Learn Emojicode
🍇 Learn about Emojicode, a programming language that consists of emojis! 🍉Beginner Friendly1 hour