HELP! stuck on number 3 on functions


#1



Replace this line with your code.


#3

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

#4

i broke it HELP!!!!!!!!!!!!!!!!!!!!!


#5

you need to add a function call


#6

should be

squared = n ** 2
return squared

then you print after this.
also, print should be out of the function.


#7

not true, this is the default code provided by the exercise:

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.

all you need to do is add a function call on line 9 (as mentioned in the comments)

so this:

is something you shouldn't do.

The last two lines of your reply are just confusing. And again, not what you have to do for the exercise


#8

thanks karray that really helped


#9

No problem! You can mark the post as solved by clicking on the solution button(a tick in a box).
Thanks!


#10

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.