Issue
I have two lists. One with the name of cities [Milwaukee, Seattle, Minneapolis]
and another list with the cities' corresponding populations [30, 45, 15]
.
I want to print the name of the city with the highest population (I need the code to print 'The city with the greatest population is Seattle').
Solution
cities=["Milwaukee", "Seattle", "Minneapolis"]
population=[30, 45, 15]
print (cities[population.index(max(population))])
Answered By - Manish Kumawat
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.