4/15 whats wrong in my code


print 'Welcome to the Pig Latin Translator!'

raw_input("enter a word:")
print original
   if len(original) > 0:
print original
print "empty"

Replace this line with your code.


Hi @vinod_9196 ,

Is your code indented correctly?

These should be combined into a single statement ...

raw_input("enter a word:")

See the documentation at Python: raw_input.

In the current version of your code, the second statement in the above simply assigns the raw_input function itself to original. Instead, you need to assign the result of calling the function, as in the first statement in the above, to original.


hi @appylpye

will u please provide me proper code
im confused :expressionless:


Hi, @vinod_9196 ,

The following prompts the user for input, and returns that input as a str ...

raw_input("enter a word:")

... however, it does not save the user's input to a variable, so the input just gets lost.

This merely assigns a reference to the raw_input function to original ...


... but does not assign the user's input to anything.

To both prompt the user and save the input to a variable, do this ...

original = raw_input("enter a word:")


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