> Python Function input help please?

Python Function input help please?

Posted at: 2014-12-18 
Be sure to give EddieJ a best answer.

Earlier you tried to use int() and isalpha(), but using both together caused problems.

But I told you that you have to POSTPONE using int (). I didn't tell you to remove it.

However, since you removed isalpha() so now it's OK to use int ().

The bigger problem is that you seem to be just guessing without understanding what is going on.

raw_input () gets a character string. You have to convert it to an integer before you can do calculations.

So,

x = int (raw_input ("Number to be squared: "))

which you had originally is fine, as long as you aren't using isalpha ()

raw_input has been changed to

input('prompt')

Im trying to have user input on the function below in python. Help please?

x = raw_input("Number to be squared: ")

def square(y):

z = y ** 2

return z

print square(x)