无法解析“SyntaxError:invalid syntax”

时间:2018-02-25 07:25:07

标签: python

我是Python的新手,我试图制作一个愚蠢的小无意义的代码。但是,当我尝试运行代码时,出现“无效语法”错误。这是代码:

import time

name=input("What would your name happen to be?")
print("Hello there,", name,"!")

time.sleep(3)

ohno=input("Would you like your PC to crash? (Yes or No)")
if ohno.lower() == "yes":
    print("* crashes", name,"'s PC *")
    else:
        print("Invalid answer, reload script")

if ohno.lower() == "no":
    print("Okay. Have a nice day,", name)
    else:
        print("Invalid answer, reload script")

出现错误时,它甚至不显示错误的位置。语法对我来说似乎很好..或者我可能只是一个完全白痴。好吧,如果有人可以帮助我,那将会有所帮助。提前谢谢!

0 个答案:

没有答案