Pyglatin - pleasenhelp on my code


#1

print 'Welcome to the Pig Latin Translator!'

# Start coding here!
# Getting the input
original = raw_input( "please enter a word")

#checking the input
if ( len(original) > 0 ):
    print " the entered word is %s. " %(original)
else:
    print " empty "

THIS IS MY CODE AND IT IS WORKING IN OUTPUT CONSOLE. STILL AM GETTING THE MSGS LIKE ''original had more than 0 characters but it did not get printed'' & "Does your code print empty"

IT IS NOT TAKING ME TO NEXT LESSON. PLEASE HELP


#2

try to get rid of the leading and trailing spaces in the print statements.
Also just

print original

like this

# Start coding here!
# Getting the input
original = raw_input( "please enter a word")

#checking the input
if ( len(original) > 0 ):
    print original
else:
    print "empty"

#3

Thanks a lot for the help. your suggestion helped me out. But curious to know what went wrong in my codings? and why it didnt work out ?


#4

when they test your code they are just checking for the original string that was input.
Adding any other statements to it makes it wrong because that's not what they are expecting.
e.g

if original is 'codeacaemy'
#their test will check strictly for the string 'codeacademy'

adding some statements to it like

'the entered word is codeacademy'
#will cause the tester to fail the code because it did not find
#what it was looking for