print 'Welcome to the Pig Latin Translator!'
raw_input("Enter a word:")
original = raw_input()
if len(original) > 0 and orginal.isalpha():
print raw_input()
else: #<---- this is returning a syntax error
print "Not real Word try again please"
我是python的新手,编码一般是搜索代码学院网站上的提示,我找不到任何问题的解决方案
答案 0 :(得分:1)
你对别人的缩进是错误的:
if len(original) > 0 and orginal.isalpha():
print raw_input()
else:
print "Not real Word try again please"
else
:
if len(original) > 0 and orginal.isalpha():
print raw_input()
else: #<---- this is returning a syntax error
^else should be starting here
print "Not real Word try again please"
在python缩进中定义块语句,因此它们正确且一致地对齐
非常重要