Working but


#1



https://www.codecademy.com/courses/python-beginner-2W5v7/0/5?curriculum_id=4f89dab3d788890003000096#

There actually are no error codes but the way in which the code is being read is kinda wierd

Welcome to the Pig Latin Translator!
What's your name? test
test
Enter a word test
test
test
None

VS

Welcome to the Pig Latin Translator!
What's your name? 1
1
Enter a word 1
1
empty
None


I would expect for the when a number is entered for "empty" to be printed.


print 'Welcome to the Pig Latin Translator!'

name = raw_input("What's your name?")
print name

original = raw_input("Enter a word")
print original

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


#2

empty does get printed?
Welcome to the Pig Latin Translator!
What's your name? 1
1
Enter a word 1
1
empty
None

I don't see a problem


#3

It just looks weird because the 1 gets printed on top of the empty, and the function fails as defined by the code academy :slight_smile:


#4

if you add additional print statements:

print original

before the condition checking, then yes, 1 gets printed