編集: ちょっと簡単な質問 これは素晴らしいことですが、私の心配はYESとYESを入力するとどうなりますか?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()
申し訳ありません、申し訳ありません、私はかなり以前はすべてのナイターに疲れています。
continueステートメントは、ループの残りの部分をスキップするために使用されます。 ullerの例を教えてください。 – gonczor
複数の 'if'を持たないでください。入力された文字列を小文字に変換し、それを 'はい'と比較するだけです。完全なループを表示すると、不完全なコードからエラーを判断することは困難です。 –