# What is a Dictionary

Dynamo 2.0 introduces the concept of separating the dictionary data type from the list data type. This change can pose some significant changes to how you create and work with data in your workflows. Prior to 2.0, dictionaries and lists were combined as a data type. In short, lists were actually dictionaries with integer keys.

### **What is a dictionary?**

A dictionary is a data type composed of a collection of key-value pairs where each key is unique in each collection. A dictionary has no order and basically you can “look things up” using a key instead of an index value like in a list. *In Dynamo 2.0, keys can only be strings.*

### **What is a list?**

A list is a data type composed of a collection of ordered values. In Dynamo, lists use integers as index values.

### **Why was this change made and why should I care?**

The separation of dictionaries from lists introduces dictionaries as a first-class citizen that you can use to quickly and easily store and lookup values without needing to remember an index value or maintain a strict list structure throughout your workflow. During user testing, we saw a significant reduction in graph size when dictionaries were utilized instead of several `GetItemAtIndex` nodes.

### **What are the changes?**

* *Syntax* changes have occurred that change how you will initialize and work with dictionaries and lists in code blocks.
  * Dictionaries use the following syntax `{key:value}`
  * Lists use the following syntax `[value,value,value]`
* *New nodes* have been introduced to the library to help you create, modify, and query dictionaries.
* Lists created in v1.x code blocks will automatically be migrated on load of the script to the new list syntax that uses square brackets `[ ]` instead of curly brackets `{ }` \\

![](/files/l0pL0bRVinrnGPzIQ6qH)

***

### **Why should I care? What would you use these for?**

In computer science, Dictionaries - like lists- are collections of objects. While lists are in a specific order, dictionaries are *unordered* collections. They are not reliant on sequential numbers (indices), instead, they utilize *keys.*

In the image below we demonstrate a potential use case of a dictionary. Often times dictionaries are used to relate two pieces of data that might not have a direct correlation. In our case, we are connecting the Spanish version of a word to the English version for later lookup.

![](/files/Le31wl68jHkwql9NbdLs)

> 1. Build a dictionary to relate the two pieces of data.
> 2. Get the value with the given key.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://primer2.dynamobim.org/5_essential_nodes_and_concepts/5-5_dictionaries-in-dynamo/1-what-is-a-dictionary.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
