raw_input
returns a string … you cannot square a string (or raise it to any power for that matter)
try
def square(n):
n = int(n) #this will try to force it to be an integer instead of a string
...
print square(n)
beware if a user types “hello” or something though .. as it cannot convert that to an integer
2
solved Why won’t my python program work?