import random
def is_game(choice,y):
if (choice == "가위" and y == "보") or (choice == "바위" and y == "가위") or (choice == "보" and y == "바위"):
print("축하합니다. 당신이 이겼습니다.")
elif (choice == "가위" and y == "바위") or (choice == "바위" and y == "보") or (choice == "보" and y == "가위"):
print("이런.. 당신이 졌습니다.")
elif (choice == "가위" and y == "가위") or (choice == "바위" and y == "바위") or (choice == "보" and y == "보"):
print("비겼습니다.")
else:
print("입력을 잘못했습니다.")
def is_random():
x = random.randint(1,3)
if x == 1:
return "가위"
elif x == 2:
return "바위"
else:
return "보"
choice = input("가위바위보 게임입니다. 무엇을 낼지 입력해주세요 : ")
print(f"사용자 : {choice}")
y = is_random()
print(f"컴퓨터 : {y}")
is_game(choice,y)