Stuck on Python: PygLatin


File "python", line 5
var original = raw_input('Prompt')
SyntaxError: invalid syntax

Replace this line with your code. 
print 'Welcome to the Pig Latin Translator!'

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


This isn't javascript. No need for the var in front of original.
Also, you can simply put the above raw_input with original. Instead of having two different raw_inputs.


Unlike in JavaScript, when defining variables in Python you don't need the var keyword - you only put the variable name and the value.

Also, when prompting the user for input you assign raw_input or input (depending on which version of Python in use) to the variable directly.

Your code should really look like this:

original = raw_input("Enter a word:")


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