What is wrong with my code :/


#1

print 'Welcome to the Pig Latin Translator!'

raw_input("Enter a word:")
original=raw_input
if len(original) > 0:
print original
else:
print"empty"


#2

Hello, @terarockstar62850!
The problem is that you didn't store the value you got after prompting the message "Enter a word:" for the user.
You should've done:

original = raw_input("Enter word:")

Best regards,
g4be


#3

you shouldn't do it this way :slightly_smiling:

raw_input() is a function, and you just take the function and assign it to a variable (you should've written raw_input(), but no worries)

Instead, try:
original = raw_input("Enter a word: ")
which will assign the entered word to the variable "original" :smiley:


#4

Thanks guys!This website is amazing!


#5

if i want to use isalpha function what would be the condition ?
ans syntax


#6

You could add that to the same line as the

if len(original) > 0:

just put an "and" to it:

if len(original) > 0 and original.isalpha():


#7

Does it work if I do it as?

original = raw_input()

or do I have to do

original = raw_input("Enter a word:")

If yes to the latter, can you explain what would happen differently between the two? Ty


#8

@micac: The raw_input() function is used to prompt a message to the user, if such exist between the parentheses, and will line a line from input, convert into string and return that to you.
The difference bewteen both is that one will print a message to let the user know what he/she will do while the other will simply wait for the user to inform something but will not print any sort of instruction.