蟒蛇 2.7
我正在为 PygLatin Translator 编写代码。这是我的代码:
print"Welcome to the English to Pig Latin translator!"
original=raw_input("Enter a word to translate. Any word.") #Takes an input
if not original=="" or original==" " and original.isalpha()==True: #Checks that 'original' is not an empty text field and also is not a number.
print original #If both conditions are true then prints 'original'
else: #If both conditions don't come out true then prints an error.
print"Either the field is empty or your entry was a number."
如果我输入 123,它仍然会打印 123,即使它是一个数字。如果输入包含数字,则应该执行 else 块。我的代码有什么问题?请用简单的话解释一下,因为我只是一个 Python 初学者。