1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | city_info = [('¼¿ï', 9765), ('ºÎ»ê', 3441), ('ÀÎõ', 2954), ('±¤ÁÖ', 1501), ('´ëÀü', 1531)] max_pop = city_info[0][1] min_pop = city_info[0][1] total_pop = 0 max_city = city_info[0][0] min_city = city_info[0][0] for city in city_info: total_pop += city[1] if city[1] > max_pop : max_pop = city[1] max_city = city[0] if city[1] < min_pop : min_pop = city[1] min_city = city[0] print('ÃÖ´ëÀα¸: {0}, Àα¸: {1} õ¸í'.format(max_city,max_pop)) print('ÃÖ¼ÒÀα¸: {0}, Àα¸: {1} õ¸í'.format(min_city,min_pop)) print('¸®½ºÆ® µµ½Ã Æò±Õ Àα¸: {0} õ¸í'.format(total_pop / len(city_info))) | cs |