Call and Return Help


#1



https://www.codecademy.com/courses/python-beginner-c7VZg/1/2?curriculum_id=4f89dab3d788890003000096#

Oops, try again. Your code looks a bit off. Check the Hint if you need help! Your code threw the following error: square() takes no arguments (1 given)

I don't know what else to do. I have tried indenting, using print, using def, and indenting those as well. There is no other thing I can think of that will make this error go away. If i indent it tells me "did you remember to call the square function of 10?


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)


#2

Code looks fine. Try refreshing the page.


#3

I have many times and even exited out of the program completely but it still says the same error. This is not the first time that this has happened where I am putting in the correct input and it still gives me an error.


#4

Hm...try changing browsers. I put your code into my environment and am using Chrome. It passed so I know there's nothing off with your code.


#5

I am using Chrome:( I will reset my computer I guess.


#6

Did you try other browsers (IE or Firefox)?


#7

I removed any other browsers from my laptop but I may have to download Firefox for this to work.


#8

Ah, I see. Try another browser and it that doesn't work...I guess restarting your computer would be the next option. Usually, refreshing the page would solve these.


#9

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