from random import randint
guessed = randint(0,2)
user_guess = input("What do you think the number I'm thinking of is?")
if user_guess == guessed:
print("Correct!")
else:
print("Incorrect!")
나는 코드를 반복 할 방법을 찾고 있습니다. 또는 user_guess가 추측과 같을 때까지 다른 메시지를 인쇄 할 방법을 찾고 있습니다.Python에서 완료 될 때까지 작업을 반복하는 방법
사람이 잘못 추측 한 경우 그 사실을 알리고 다른 기회를 제공 할 수 있기를 바랍니다.
감사합니다. 초급 질문에 사과드립니다.
[유효한 응답을 줄 때까지 입력을 요청] (http://stackoverflow.com/questions/23294658/asking-the-user-for-input-until-they-give-a- 유효 응답) –