有人可以帮助我,我是编程新手,无法弄清楚为什么不能运行?Python令人困惑,需要帮助
import time
import os
lives = 3
def start():
global lives
if lives < 1:
print("GAME OVER")
quit()
print("You wake up in a well.")
print("Do you climb out or get help?")
well = input("Help or Climb? ")
if well == "H" or "h" or "help" or "Help":
print("You get your phone out.")
time.sleep(2)
print("There's no charge left.")
print(" " * 3)
lives = lives - 1
print("You have", lives, "lives left.")
time.sleep(3)
os.system("cls")
start()
elif well == "C" or "c" or "climb" or "Climb":
print("You start climbing up the walls of the well.")
time.sleep(3)
print("You are close, but you lose your footing and are blinded by the sunlight,")
footing = input("Move your foot to the left or right?")
if footing == "L" or "l" or "left" or "Left":
print("You miss the step and fall.")
lives = lives - 1
start()
start()
当您尝试运行它时,它会告诉您什么? – mgilson
'well ==“H”或“h”或“help”或“Help”是错误的。 –
这样的东西:'如果well ==“H”或“h”或“help”或“Help”:'不会起作用,那么您需要'如果在[“H”,“h” ,“help”,“Help”]:'或'如果well.lower()[0] =='h':'或类似。 –