Skip to content

Commit

Permalink
JS - data structures code
Browse files Browse the repository at this point in the history
  • Loading branch information
hobojoe1848 committed Mar 17, 2018
1 parent b2ef9c7 commit e76b4bd
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 3 deletions.
6 changes: 3 additions & 3 deletions days/07-09-data-structures/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ Follow the instructions on page once you've redeemed the Bite and see if you can

## Day N+2: Your Turn!

Create a script that imports the data structures contained in the following script file in our Repo:
Create a script that imports the US States data structures contained in the following script file in our Repo:

Perform the following tasks on the data structures:
Perform the following tasks on the list and dict without looking at their contents first! Hint: Dicts are unsorted.

- Print out the 10th item in each.

- Print out the 18th key in the dictionary.
- Print out the 45th key in the dictionary.

- Print out the 27th value in the dictionary.

Expand Down
106 changes: 106 additions & 0 deletions days/07-09-data-structures/code/data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
#!python3

us_state_abbrev = {
'Alabama': 'AL',
'Alaska': 'AK',
'Arizona': 'AZ',
'Arkansas': 'AR',
'California': 'CA',
'Colorado': 'CO',
'Connecticut': 'CT',
'Delaware': 'DE',
'Florida': 'FL',
'Georgia': 'GA',
'Hawaii': 'HI',
'Idaho': 'ID',
'Illinois': 'IL',
'Indiana': 'IN',
'Iowa': 'IA',
'Kansas': 'KS',
'Kentucky': 'KY',
'Louisiana': 'LA',
'Maine': 'ME',
'Maryland': 'MD',
'Massachusetts': 'MA',
'Michigan': 'MI',
'Minnesota': 'MN',
'Mississippi': 'MS',
'Missouri': 'MO',
'Montana': 'MT',
'Nebraska': 'NE',
'Nevada': 'NV',
'New Hampshire': 'NH',
'New Jersey': 'NJ',
'New Mexico': 'NM',
'New York': 'NY',
'North Carolina': 'NC',
'North Dakota': 'ND',
'Ohio': 'OH',
'Oklahoma': 'OK',
'Oregon': 'OR',
'Pennsylvania': 'PA',
'Rhode Island': 'RI',
'South Carolina': 'SC',
'South Dakota': 'SD',
'Tennessee': 'TN',
'Texas': 'TX',
'Utah': 'UT',
'Vermont': 'VT',
'Virginia': 'VA',
'Washington': 'WA',
'West Virginia': 'WV',
'Wisconsin': 'WI',
'Wyoming': 'WY',
}


states_list = ['Oklahoma',
'Kansas',
'North Carolina',
'Georgia',
'Oregon',
'Mississippi',
'Minnesota',
'Colorado',
'Alabama',
'Massachusetts',
'Arizona',
'Connecticut',
'Montana',
'West Virginia',
'Nebraska',
'New York',
'Nevada',
'Idaho',
'New Jersey',
'Missouri',
'South Carolina',
'Pennsylvania',
'Rhode Island',
'New Mexico',
'Alaska',
'New Hampshire',
'Tennessee',
'Washington',
'Indiana',
'Hawaii',
'Kentucky',
'Virginia',
'Ohio',
'Wisconsin',
'Maryland',
'Florida',
'Utah',
'Maine',
'California',
'Vermont',
'Arkansas',
'Wyoming',
'Louisiana',
'North Dakota',
'South Dakota',
'Texas',
'Illinois',
'Iowa',
'Michigan',
'Delaware']

0 comments on commit e76b4bd

Please sign in to comment.