python if/else命令完全不起作用。在import time
import os
import sys
def zelphaMain():
def zelphaMain_Credits():
print("Coding:")
print("John Antonio Anselmo")
print("")
print("")
print(">>Back")
def zelphaMain_CreditsInput_Options():
zelphaMain_CreditsInput = input(">> ")
if zelphaMain_CreditsInput == ("back") or ("Back"):
os.system('cls')
zelphaMain()
else:
print("What you have entered is not a valid command")
zelphaMain_CreditsInput_Options()
zelphaMain_CreditsInput_Options()
def zelphaMain_Game():
print("*")
time.sleep(1)
print("*")
time.sleep(1)
print("*")
time.sleep(1)
os.system('cls')
time.sleep(1)
print("Zelpha808")
time.sleep(1)
print("")
print("Booting...")
time.sleep(8)
os.system('cls')
def zelphaMain_Menu():
print("Main Menu")
print("")
print("")
print("Welcome to Zelpha808")
print("")
print("")
print(">>Start")
print(">>Credits")
print("")
zelphaMain_MenuInput = input(">> ")
if zelphaMain_MenuInput == ("Credits") or ("credits"):
zelphaMain_Credits()
else:
exit()
zelphaMain_Menu()
zelphaMain()
当我运行程序并进入游戏主菜单时,无论我输入什么,程序都会转到zelphaMain_Credits()。在学分里,不管我输入什么,它的作用就像我输入了“back”。我不知道发生了什么,如果你们中的任何人有困惑或需要澄清,我很乐意补充更多的细节。在