Python and please explain the code and function

(15 points) Create a function that (1) accepts a list containing U.S. state information as a parameter, (2) builds a dictiona (15 points) Create a function that (1) accepts a list containing U.S. state information as a parameter, (2) builds a dictionary using the state abbreviation code as key and state name and capital in a list as the value, (3) prints the dictionary’s keys and values – one line per state, and (4) returns the dictionary to the calling program. A sample input list is (note: you must be able to accept a list with any number of states): states = [[“AK”,”Alaska”,”Juneau”], [“AZ”,”Arizona”,”Phoenix”], [“CA”,”California”,”Sacramento”}]



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *