所以我是编码的初学者,不久前我开始学习 Python!最近我正在编写自己的代码。这是一个从英语到pyg latin的翻译项目(只是一种在单词中添加“ay”的虚构语言。现在这是我的代码:
original = raw_input('Name any english word?')
if len(original) > 0 and original.isalpha(): #Testing if variable has characters and not numbers
word = original.lower()
first = word[0]
if first == 'a' or first == 'e' or first == 'i' or first == 'o' or first == 'u':
new_word = word + pyg #Word translated to pyg latin
print new_word
else:
new_word = word[1:] + word[0] + pyg
print new_word
else:
print "empty" #No word active
问题是我在第三行中不断收到 EOF 错误吗?有什么问题,什么是 EOF 错误?