3-10 가위바위보 게임

신정빈·2022년 7월 25일
0
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)
profile
떠오르는 태양

0개의 댓글