I have a location name and then a latitude and longitude for each location. I'm trying to determine the best way to express a single key with two values in Python. I was thinking this:
dict = {
'California': ('36.46715833333333', '-117.85891388888888'),
'California2': ('36.46715833333333', '-117.85891388888888'),
}
Then to add more:
dict['California'] = ('36.46715833333333', '-117.85891388888888')
But then how would I easily iterate through each and extract them?
for location in dict:
for lat, lon in location:
print lat, lon
This gives a ValueError stating it does not have more than one value to unpack. How do I iterate through this and get each lat and long?