0
私はPython 3.XでChoose Your Own Adventureゲームを作ろうとしています。私はアイドル状態のプラットフォームを使用しています。ここに私のコードのサンプルがあります。Python 3.Xがコード行にジャンプ
import time
again = True
while again == True:
print("You wake up as you normally do, but something's not quite right. What will be the first thing you do? \n Choices: \n Go back to sleep \n Get up")
action1 = input(": ")
if action1 == "Go back to sleep":
print("You lazyhead. As you were about to fall asleep, your ceiling collapsed on you and killed you. Don't be lazy.")
playAgain = input("Play again? Y/N: ")
if playAgain == "Y":
again = True
elif playAgain == "N":
again = False
明らかに、action1
とplayAgain
間のものがあります。私は私が代わりに私はちょうどプログラムを終了していないplayAgain
にジャンプしたいelif playAgain =="N"
elif playAgain =="N":
again = false
でagain = false
を交換したいです。これは私の最初の質問ですので、私の書式設定は多少奇妙なので、あまりにもそれを修正してください。
関連(http://stackoverflow.com/q/23294658)[これらは有効な応答を与えるまで、入力のためにユーザに尋ねる] –
IDLEでありませんインタープリターでは、軽量の統合開発環境(IDE)であり、 'python-idle'タグは、あなたが求めている質問には役に立たないと思われません。 –
あなたに何を求めているのかは不明です。あなたが探している振る舞いは何ですか? –