Call and response


#1

This is my code:
def square(10):
"""Returns the square of a number."""
squared = 10**2
print "%d squared is %d" % (10, squared)
return squared
Then it just says that there is an error on the 0. WHY??!!


#3

The role of this function is to return the square of a number given to it. We would need a variable to hold that number. 10 is a constant, not a variable.


#4

Just put a square(10) on line 9


#5

You would not need to add (10) in the line def square()
10 is only added where "n" is;
lines 3 & 4.
On line 9 you will call the function by just adding
square()


#6

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

Call the square function on line 9! Make sure to

include the number 10 between the parentheses.

square(10)


#9