3. Input


#1

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

Welcome to the Pig Latin Translator!
Traceback (most recent call last):
File "python", line 3, in
NameError: name 'original' is not defined


print 'Welcome to the Pig Latin Translator!'

variable_name = original('Prompt')
raw_input("Enter a word:")

I'm off track somewhere. Please advise


#2

You'd start by considering what the incorrect behaviour is, your error message has something to say so you can start with determining whether you agree with that being a problem and then you can start considering what reasons there are and what you can do to fix that.


#3

In the hint, where it says 'variable_name" it means replace it with the name of the variable not actually type "variable_name". Also, 'Prompt' should be replaced with the phrase that prompts the user for a command. Your code should be:

print 'Welcome to the Pig Latin Translator!'

original = raw_input("Enter a word:")


#4

So just to check, if you are doing original = raw_input("Enter a word:"), then you don't have to have it separately on another line? As in:

raw_input("Enter a word:")

original = raw_input("Enter a word:")

That just seems like something that would deserve its own line.


#5

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