Data Structures are key (pun intended) to mastering Python. In fact, they're so important, we're dedicating an entire 3 days to them!
Even if you're familiar with data structures, this will be a useful refresher.
Watch all of the videos. They'll provide you with the foundation you need to get working with lists, tuples and dictionaries.
Have a play with your own lists, dicts and tuples in the Python shell and familiarise yourself with them.
Feel free to watch the What we learned video as well as a recap!
Click this link: https://codechalleng.es/bites/promo/datastructures
This will take you to our CodeChalleng.es platform and give unlock a Bite for free.
Follow the instructions on page once you've redeemed the Bite and see if you can solve the problem!
Create a script that imports the US States data structures contained in the following script file in our Repo: https://github.com/talkpython/100daysofcode-with-python-course/blob/master/days/07-09-data-structures/code/data.py
Perform the following tasks on the list and dict. The less you look at them, the better this exercise will be. Remember: Dicts are unsorted.
-
Print out the 10th item in each.
-
Print out the 45th key in the dictionary.
-
Print out the 27th value in the dictionary.
-
Replace the 15th key in the dictionary with the 28th item in the list.
Be sure to share your last couple of days work on Twitter or Facebook. Use the hashtag #100DaysOfCode.
Here are some examples to inspire you. Consider including @talkpython and @pybites in your tweets.
See a mistake in these instructions? Please submit a new issue or fix it and submit a PR.