Whats wrong with my code? 3/19 functions


#1

Whats wrong with my code?

def square(n):
"""Returns the square of a number."""
squared = n**2
print "%d squared is %d." % (n, squared)
return squared

def square(10):
squared = 10**2
print "%d squared is %d." % (10, squared)
return squared

It just comes up with a syntax error can anyone help?

"""Returns the square of a number."""
squared = n**2
print "%d squared is %d." % (n, squared)
return squared

def square(10):
squared = 10**2
print "%d squared is %d." % (10, squared)
return squared

It just comes up with a syntax error can anyone help?


#2

Hi,

Don't forget your indentations.

Instead of your second function, try just calling your function: square(10)

Good luck


#3

I do have my indentations it just for some reason isn't putting them in.


#4

Did you solve it of still stuck?
If still stuck, please post your code you have now.