편집 : 그냥 간단한 질문 그럼 좋겠지 만 모두가 그렇습니다.continue 루프의 오용, 대문자와 소문자로 된 대답의 비교 입력
import sys
import random
roll_again = "yes"
msg=input('Dice Rolling Simulator. Let the dices be ever in your favour. Press ENTER to start our game of luck')
if msg!=input:
pass
while roll_again == "yes":
min = 1
max = 6
face = random.randint (min,max)
print (face)
cmd=input("Would you like to roll the dice again? Type yes if you do.")
if cmd != roll_again : #if it is not 'yes' then system automatically exits.
print ("One who doesn't throw the dice can never expect to score a six. -Navjot Singh Sidhu")
sys.exit()
미안하지만, 나는 이전의 모든 nighter로부터 꽤 피곤하고 아마도 약간 지쳤습니다.
continue 문은 루프의 나머지 부분을 건너 뛰는 데 사용됩니다. 룰러 예제를 제공 할 수 있습니까? – gonczor
여러 개의 'if'가 없습니다. 입력 된 문자열을 소문자로 변환하고 '예'와 비교하십시오. 완전한 루프를 보여 주면 불완전한 코드로 오류를 판단하기가 어렵습니다. –