Learn Python Episode #12: Dictionaries

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
·@jo3potato·
0.000 HBD
Learn Python Episode #12: Dictionaries
https://youtu.be/4f-RiJXVSew

In this video we will cover dictionaries in Python. In the previous video when we created a list we used square brackets and comma separated values. To create a dictionary we will use curly brackets instead of the square brackets. In a previous video I may have mentioned that we do not use curly brackets in Python, and that was a lie. What I meant is that we don't need to wrap code blocks in curly brackets like PHP or JavaScript. So, let's go ahead and define a dictionary.

<pre>{"name": "Nick", "age": is 27, "hobby": "code"}</pre>
<p>

 As you can see, instead of just comma separated values we used in the list, the dictionary uses a key and a value separated by a colon. You can access an item in the dictionary like so:

<pre>{"name": "Nick", "age": is 27, "hobby": "code"}{"name"}</pre>
<p>

Python will then print out "Nick." Dictionaries will be very important when we get to the JSON part of the course, because we will need to parse though a ton of data.

<b>Get The Learn to Code Course Bundle!</b>
<b>https://josephdelgadillo.com/product/learn-to-code-course-bundle/</b>

Best,
Joseph Delgadillo
Web: https://josephdelgadillo.com/
YouTube: https://www.youtube.com/c/JosephDelgadillo
Steemit: https://steemit.com/@jo3potato
👍 , , , , , , , , , , , ,