Pyg Latin


#1

I am trying to make the pyg latin thing

I have this code :

print 'Welcome to the Pig Latin Translator!'

raw_input("Enter a word:")
original= raw_input

if len(original) > 0:

print(original)
else:
print("empty")

. It keeps saying that the bolded line is wrong. Why?

Thanks for helping (or trying to)!


#2

Error messages usually say more than just "wrong", have you considered what it has to say?

If you post code, make sure it's intact. It should be possible to copy your code and run it without modifying anything and end up with the same result as you describe.


#3

It usually says :
Traceback (most recent call last):
File "python", line 6, in
TypeError: object of type 'builtin_function_or_method' has no len()


#4

Why are you trying to get the length of a function?


#5

@teraace24201: you are mixing up variable and function. In this case built in function raw_input().

You can set an output from a function to a variable.


#6

By the way, raw_input(); is a built-in function where you can consider input = output like a continuous process.

Where as almost same function input() which is slightly different. Difference between raw_input and input


#7

I am not sure if this question is open or closed. Set the variable original to equal raw_input(). raw_input is the name of a function not the variable from the function.

original=raw_input()