我创建了一个Pig Latin翻译器。我运行程序,它打开,我输入一个单词,一旦我点击'enter',程序就会关闭。这是为什么?
userWord = input('Enter any word:')
pig = "ay"
if len(userWord) > 0 and userWord.isalpha():
word = userWord.lower()
first = word[0]
new = word[1:] + first + pig
print(new)
else:
print("INPUT INVALID")