def restudy():
print "OK, since you decided to restudy at MIANYANG high school, you must work hard!"
print '''
Now, it's time to determine your destiny.
Please answer the questions below:
what's the result of 1+1?
if you give the right answer, you can go to Shanghai; but if you can't
you'll be caught in here forever.
'''
test = raw_input("> ")
if test == "2":
print "you succeed!"
shanghai()
else: # that's the error line
restudy()
这就是终端向我显示的结果:
else: ^ SyntaxError: invalid syntax
我的代码有什么问题?因为我认为这似乎是正确的。 希望有人可以帮助我。 谢谢!