PygLatin Step 4: MY CODE IS NOT WORKING!


#1

https://www.codecademy.com/courses/learn-python/lessons/pyglatin/exercises/check-yourself?action=lesson_resume&link_content_target=interstitial_lesson

So I am trying to make a Pig Latin translator as a python exercise. I know that it is supposed to be a really basic project but I don’t see what I’m doing wrong. I believe the problem might be on line 4 where I need to determine what I am supposed to print. If someone could help me figure out the right code so I could move on that would be great!

```

print 'Welcome to the Pig Latin Translator!'
original = raw_input("Enter a word: ")
if len(original) > 0:
print len(original)
else:
print “empty”


#2

The instructions say to print the user’s word, not the word’s length.


#3

@gearxl I think @overcantor is correct, you told the program to print len() instead of the original.

This is the code I used and it worked.

print ‘Welcome to the Pig Latin Translator!’

Start coding here!

original = raw_input("Enter a word: ")

if len(original) > 0:
print original

else:
print “You did not enter a word”


#4

Thanks for the assistance


#5

I tried the code but it still says that there is an issue in the print original line.


#6

Can you provide the error message? It will help in fixing the issue, could be a simple syntax (whitespace) error.


#7

I figured out what the error was. I was supposed to indent on a few lines. Thank you for the sample code!


#8

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