You can simply loop over a sorted list (first by the state, then by name):
city_list = [('Huntsville', 'AL'), ('Decatur', 'AL'), ('Anchorage', 'NV'),
('Nome', 'AK'),('Selma', 'AL'), ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'),
('Tucson', 'AZ')]
sorted_list = sorted(city_list, key=lambda x:
I think I will just do it with this way..
I created two lists (one is for states,one is for city and state)
And I just compared them by for loops. sorry for newb question as I am
new to python.
On 3월18일, 오전12시21분, Kenny nis...@gmail.com wrote:
I have
city_list = [('Huntsville', 'AL'),
2 matches
Mail list logo