1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # # µû¶óÇÏ¸ç ¹è¿ì´Â ÆÄÀ̽ã°ú µ¥ÀÌÅÍ°úÇÐ(»ý´ÉÃâÆÇ»ç 2020) # LAB 5-11 ¹«ÇÑ ¹Ýº¹¹®À¸·Î ¼ýÀÚ ¸ÂÃ߱⠰ÔÀÓÀ» ¸¸µéÀÚ, 134ÂÊ # import random tries = 0 guess = 0 answer = random.randint(1, 100) print("1ºÎÅÍ 100 »çÀÌÀÇ ¼ýÀÚ¸¦ ¸ÂÃ߽ÿÀ") while guess != answer and tries <= 10: guess = int(input("¼ýÀÚ¸¦ ÀÔ·ÂÇϽÿÀ: ")) tries = tries + 1 if guess < answer: print("³·À½!") elif guess > answer: print("³ôÀ½!") if tries < 11: print("ÃàÇÏÇÕ´Ï´Ù. ÃÑ ½ÃµµÈ½¼ö=", tries) else: print("10¹ø ³Ñ°Ô ½ÃµµÇÏ¿´½À´Ï´Ù.") | cs |