avatar Bite 89. Playing with lists and dicts

In this Bite you are presented with a us_state_abbrev dict and a states list.

Complete the four methods in the template below (you might have to scroll down): get_every_nth_state, get_state_abbrev, get_longest_state and combine_state_names_and_abbreviations, following the instructions in their docstrings.

We hope this gives you a good feeling of how you can get data out of these two data structures.

Of course there is a lot more to it, you will come to appreciate the power of each data structure by continuous usage. So keep coding and improving your Python skills. And have fun!

Login and get coding
go back Intermediate level
Bitecoin 3X

620 out of 662 users completed this Bite.
Will you be Pythonista #621 to crack this Bite?
Resolution time: ~63 min. (avg. submissions of 5-240 min.)
Pythonistas rate this Bite 3.54 on a 1-10 difficulty scale.
» You can do it! 😌

Focus on this Bite hiding sidebars, turn on Focus Mode.

Ask for Help