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'), ('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