Pyglatin 6/11


#1

Hello Forum,

Every time i type my name in into the console when i run the code. The console response replies “Empty”.

I’m unsure why this responds “Empty” within the console when no numbers are in my name? Is my code wrong, and somebody please explain?

Thank you in advance

Brendan

print ‘Welcome to the Pig Latin Translator!’

Start coding here!

original = raw_input(“What is your name:”)
if len(original) > 0 and original.isalpha():
print original
else:
print “empty”


#2

Have you by any chance written your full name?
Let’s say you gave as input “John Doe”. "John Doe".isalpha() will return False because the white space in the string isn’t considered alpha. For it to return True you should have type “John” or “Doe”.
That’s one possible reason.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.