[Python Exam] 가위바위보 게임 예제
import random import time import os # 만약 가위바위보 게임이 무한반복되게하려면 onwhile 변수의 인자를 "True"로 설정해주면 된다. onwhile = True while True: if os.name == "nt": os.system("cls") else: os.system("clear") choice = ["가위", "바위", "보"] print("가위, 바위, 보를 선택해주세요") for i in range(3): print(i+1,end=". "+choice[i]+"\n") userchoice = int(input("-> ")) if userchoice == 1: userchoice = choice[0] elif userchoice == 2: userchoice..
2019. 8. 15. 05:15