Test/Python(20220101~)
Day4_가위바위보
kiostory
2022. 1. 5. 19:32
rock = '''
_______
---' ____)
(_____)
(_____)
(____)
---.__(___)
'''
paper = '''
_______
---' ____)____
______)
_______)
_______)
---.__________)
'''
scissors = '''
_______
---' ____)____
______)
__________)
(____)
---.__(___)
'''
#Write your code below this line ?
choice = int(input("What do you choose? Type 0 for Rock, 1 for Paper, 2 for Scissors. "))
if choice == 0 :
print(rock)
elif choice == 1 :
print(paper)
elif choice == 2 :
print(scissors)
else :
print("Choose the correct one.")
import random
computer_chose = random.randint(0,2)
print(f"Computer chose \"{computer_chose}\".\n\n")
if computer_chose== 0 :
print(rock)
elif computer_chose== 1 :
print(paper)
elif computer_chose== 2 :
print(scissors)
if choice == computer_chose :
print("\nDraws.")
elif (choice==0 and computer_chose==2) or (choice==1 and computer_chose==0) or (choice==2 and computer_chose==1) :
print("\nYou win.")
else :
print("\nYou lose.")