Python PygLatin Translator Question


#1

Why does this code return Empty if my input is: “Hey there” But it works if it is like this: “Heythere” in other words whenever we have a space it returns empty…

print ‘Welcome to the Pig Latin Translator!’

# Start coding here!

original = raw_input("Enter a word: ")

if len(original) > 0 and original.isalpha():
    print original
else:
    print "Empty"

#2

Because that phrase fails the isalpha test owing that it contains a space character. Spaces are not alpha characters.