Check Yourself. Pig Latin


#1

When I click submit and enter a word, the console skips to the next line, waits for me to enter another word, and then when I do it prints both the if and else statement.

print 'Welcome to the Pig Latin Translator!'

Start coding here!

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

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

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


#2

Reduce this to just,

original = raw_input("Enter a word")

#3

original = raw_input("Enter a word.")

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

This still doesn't work. It says, oops did you accidentally delete the variable called original


#4

okay it works now. I changed a few things around. Thank you for your help.


#5

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