direction = input("enter a direction: ")
if direction != "quit" and direction != "go north" and direction != "go south" and direction != "go east" and direction != "go west" and direction != "go up" and direction != "go down" and direction != "look":
print ("please enter in the following format, go (north,east,south,west,up,down)")
elif direction == "quit":
print ("OK ... but a small part of you may never leave until you have personally saved Muirfieland from the clutches of evil .. Bwahahahahahah (sinister laugh) ... the game should then end.")
elif direction == "look":
print ("You see nothing but endless void stretching off in all directions ...")
else:
print ("You wander of in the direction of " + direction)
Pythonでこれを行う方法を知る必要があります。たとえば、ユーザー入力の最初の2文字をスキャンする必要があります
i = user_input
#user inputs go ayisgfdygasdf
ユーザー入力をスキャンし、最初の 2 文字が go かどうかを確認し、go である場合は 2 番目の単語 (この場合は「ayisgfdygasdf」) を認識せず、「申し訳ありませんが、できません」と出力できるようにする必要があります。それ"