1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | # # µû¶óÇÏ¸ç ¹è¿ì´Â ÆÄÀ̽ã°ú µ¥ÀÌÅÍ°úÇÐ(»ý´ÉÃâÆÇ»ç 2020) # LAB 7-6 µµ½ÃÀÇ À̸§°ú Àα¸¸¦ Æ©Ç÷Π¹¾îº¸ÀÚ, 192ÂÊ # # ´ÙÀ½°ú °°Àº ¸®½ºÆ®°¡ »ý¼ºµÇ¾î ÀÖ´Ù. city_info = [('¼¿ï', 9765), ('ºÎ»ê', 3441), ('ÀÎõ', 2954), ('±¤ÁÖ', 1501), ('´ëÀü', 1531)] max_pop = 0 min_pop = 999999999999999999 total_pop = 0 max_city = None min_city = None for city in city_info: total_pop += city[1] if city[1] > max_pop : max_pop = city[1] max_city = city if city[1] < min_pop : min_pop = city[1] min_city = city print('ÃÖ´ëÀα¸: {0}, Àα¸: {1} õ¸í'.format(max_city[0], max_city[1])) print('ÃÖ¼ÒÀα¸: {0}, Àα¸: {1} õ¸í'.format(min_city[0], min_city[1])) print('¸®½ºÆ® µµ½Ã Æò±Õ Àα¸: {0} õ¸í'.format(total_pop / len(city_info)) ) | cs |