Pyglatin (Check yourself)


#1


Can someone please help me?

Can someone please help me?

print 'Welcome to the Pig Latin Translator!'
original = ""
if len(original) > 0:
print "the user's word".
else:
print "empty"

Start coding here!

raw_input("Enter a word:")
original=raw_input


Replace this line with your code.


#2

What this line has actually done is copy the string representation of the raw_input function. We can now write,

>>> user = original("Enter a word: ")
Enter a word: surprise
>>> user
'surprise'
>>>

The thing to do is write the raw_input statement like above.


#3

Hi, Thanks for your help but I am afraid I still don't get it... This is how it looks in my computer..

Please see the pic.


#4

You haven't changed that line. Make original equal to the line above it.

original = raw_input( ... )

#5

Hi, Thank you so much for your help.. Now I got it.. But I am wondering why do I need to put (... ) after raw_input.


#6

Remove the line, raw_input( ... ) since it is not doing anything except making you input twice.

The parens contain the function call arguments, which in the case of raw_input() is as you have above, the prompt text. When you see ( ... ) that just means I've left the text bits out of the example.

A tip for the next lessons... Write your new code where print original is, and take that line out. You won't need it once you start adding code to the if statement.


#7

it didnĀ“t work for me


#8

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