1. Guessing Game
01 Sep 2019 | Python
import random
true_number = random.randint(1, 49) # 1~49까지 랜덤 넘버
true_number
guess_number = int(input("Enter your guess between 1 and 49: "))
guess_number
while True:
if guess_number == true_number:
print('YOU ARE RIGHT! GOOD JOB!')
break
elif guess_number < true_number:
print('YOUR GUESS IS LOW, TRY AGAIN')
guess_number = int(input("Enter your guess between 1 and 49: "))
elif guess_number > true_number:
print('YOUR GUESS IS HIGH, TRY AGAIN')
guess_number = int(input("Enter an integer from 1 and 49: "))
import random
true_number = random.randint(1, 49) # 1~49까지 랜덤 넘버
true_number
guess_number = int(input("Enter your guess between 1 and 49: "))
guess_number
while True:
if guess_number == true_number:
print('YOU ARE RIGHT! GOOD JOB!')
break
elif guess_number < true_number:
print('YOUR GUESS IS LOW, TRY AGAIN')
guess_number = int(input("Enter your guess between 1 and 49: "))
elif guess_number > true_number:
print('YOUR GUESS IS HIGH, TRY AGAIN')
guess_number = int(input("Enter an integer from 1 and 49: "))
Comments