PygLatin - Check Yourself


#1



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


I have absolutely no idea what to do here, the help box doesn't help at all.
Can anybody help me? I've been fine up to this point.


print 'Welcome to the Pig Latin Translator!'

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


#2

Well lets work through this lesson step by step then! :smiley:

1.) Add an if statement that checks that len(original) is greater than zero. Don't forget the : at the end of the if statement!
Well this should be self explanatory enough. We need to write A.) if statement B.) that checks C.) len(original) D.) > 0 and don't forget the : at the end!! So our if statement should start to take form like this:

if len(original) > 0 //see all the steps?

2.) If the string actually has some characters in it, print the user's word.
So in this step we are to A.) print B.) user's word and seemingly C.) under the if statement. Now this one you might have to be a little creative the start is simple.

print

Now, how do we accomplish our task? we can print the original variable contains our original word.

print original

3.) Otherwise (i.e. an else: statement), please print "empty".
Now the final step: 1.) else statement 2.) next print statement 3.) print statement includes "empty" as its statement
So we are going to follow the outline of the if statement and we should get:

else:
    print "empty"

Hopefully this has helped! And please take no notice if you feel like I am treating you as a child. I tend to explain things better in that matter and in no way am I insulting anyone. Thanks! :smiley: :thumbsup:


#3

Hopefully this has helped! And please take no notice if you feel like I am treating you as a child. I tend to explain things better in that matter and in no way am I insulting anyone.

I understand haha, it definitely helped me!
I dunno why but I just could not get through that problem.

Thank you so much! :slight_smile:


#4

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