4.Check yourself


#1



Replace this line with your code. 

Hi,
could you help me please? I didn't find my mistake... https://www.codecademy.com/courses/python-beginner-2W5v7/0/4?curriculum_id=4f89dab3d788890003000096#
Thank you a lot in advance!


#2

Please pos your code and not just a link to the exercise :slight_smile: In fact, the code is more important than the link but both included is even better. :smile:


#3

print 'Welcome to the Pig Latin Translator!'

Start coding here!

raw_input("Enter a word:")
original = raw_input
if len(original) > 0:
print original
else:
print "empty"


#4

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


#5

If you want help, do please make sure that we understand your code clearly. So, assuming your indentation is correct -

raw_input("Enter a word:")  // Here and
original = raw_input  // here is your mistake.
if len(original) > 0:
    print original
else:
    print "empty"

You ask for raw_input from user, but do not save it anywhere. So, to fix this, first assign original to raw_input and then ask user for his/her contribution. Like this:

original = raw_input("Enter a word:")
if len(original) > 0:
    print original
else:
    print "empty"

Here, you let your code know that anything user typed in raw_input will be assigned to variable original. And then you use it further in your code.

Happy coding sire!


#6

Thank you very much for your help!


#7

No problem, let the code be with you.


#8

I did the mistake to string original when coding
print "original" when in fact was unstringed.


#9

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