From f3be90e7b3fc44c1f18eceaf43dee591efed4ffe Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Wed, 3 Mar 2021 13:01:35 -0500 Subject: [PATCH] Update python.md --- python.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/python.md b/python.md index 745d54c..4a2fa25 100644 --- a/python.md +++ b/python.md @@ -120,6 +120,19 @@ print(a[1]) #5 print(a[4]) #5.6 ``` +## Store an object as a "dictionary" + +JS objects are called dictionaries in Python and use array access syntax: + +```python +my_car = { + "brand": "Ford", + "model": "Mustang", + "year": 1964 +} +print(my_car["brand"]) +``` + ## Perform a set of commands depending on a situation ```python