Check yourself


#1

This is what i put in for the exercise:
print 'Welcome to the Pig Latin Translator!'

Start coding here!

raw_input("Type a Word:")
original = raw_input
if len(orignal) >0:
print "Good to Go"
else:
print "Enter Valid Character"

This is the reply i got in the console window:
Welcome to the Pig Latin Translator!
Type a Word: pool
Traceback (most recent call last):
File "python", line 6, in
NameError: name 'orignal' is not defined

I really I'm not sure where i am wrong and i really need some help with this.


Check Yourself!
#2

you should prompt the user for input and store the result of the prompt in original, this is a single line of code

check your spelling


#3

yeah i have gotten through that......Thank you!!


#4

the wrong is in spelling of original
and the raw_input should be raw_input()
the correct code

original = raw_input("Type a Word:")
if len(original) >0:
print "Good to Go"
else:
print "Enter Valid Character"


#5

out of curiosity, why do I have to enter my word twice?


#6

if you code it right, you only need to enter it once

you need one word from the user, why would you prompt twice?


#7

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