4. Check yourself


#1



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


"The original variable ("raw_input") had more than 0 characters but did not get printed."


"Good" gets printed but the error message still shows


print 'Welcome to the Pig Latin Translator!'

# Start coding here!
name = raw_input("What is your name?")
original = "raw_input"
if len(original) > 0:
    print "Good"
else: 
    print "Please enter your name"


#2

Here,

leave it as an open string like this.

original =""

On else, you should print "empty" and not what you did. See instructions.

   
else:
    print "empty"

Finally, I don't see a need for this from the instruction.

:slight_smile:


#3

Thanks, it worked. Corrected all the mistakes you pointed out.


#4

There's one problem, I have passed it but it always prints "empty", whenever i click submit and then enter my name. It should print "good", right?


#5

Yeah, so we correct that by asking that if the if statement is fulfilled, it should print it, Like this.

print 'Welcome to the Pig Latin Translator!'

# Start coding here!
original = raw_input("Enter a word: ")

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

I am sorry that my original post didn't satisfy all conditions. :disappointed:


#6

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