I have
city_list = [('Huntsville', 'AL'), ('Decatur', 'AL'),
             ('Anchorage', 'NV'), ('Nome', 'AK'),('Selma', 'AL'),
             ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ')]

And I want to list it in HTML.

I don't know what would be the best solution for this.

so Html will display

AL
Decatur
Huntsville
Selma

AZ
Flagstaff
Tucson
Phoenix

....

I don't care about sorting. The solution I can think of is use two for
loops and one if loop to search and display. I don't think this is not
a good approach.

Reply via email to