19. Errors



this is the error message i receive, i odnt understand where i am going wrong
Oops, try again. It looks like your method returns for an input of -20, when it should return 400.

def square(n)
puts n ** 2 


The task is as follows:

Write a method, square, that takes a number as an argument and implicitly returns the square of that number.


Are you returning or printing? Is there a difference?


ive managed ot correct the issue. thanks


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