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 | # # µû¶óÇÏ¸ç ¹è¿ì´Â ÆÄÀ̽ã°ú µ¥ÀÌÅÍ°úÇÐ(»ý´ÉÃâÆÇ»ç 2020) # LAB 6-4 ¸®½ºÆ®¿¡¼ ÃÖ´ñ°ª/ÃÖ¼Ú°ªÀ» Æí¸®ÇÏ°Ô Ã£´Â ÇÔ¼ö, 160ÂÊ # def getMinMax(mylist, method='max'): minValue = 999999999999999999999999999999999 maxValue = -minValue if method == 'max' : for value in mylist: if value > maxValue: maxValue = value; return maxValue elif method == 'min' : for value in mylist: if value < minValue: minValue = value; return minValue else : print('illegal method') list_data = [27, 90, 30, 87, 56] while(True): print(list_data) s = input('ÃÖ´ë°ªÀ» ¿øÇϸé max, ÃÖ¼Ò°ªÀ» ¿øÇϸé minÀ» ÀÔ·ÂÇϽÿÀ: ') print(getMinMax(list_data, s)) | cs |