19. Errors


#1



https://www.codecademy.com/courses/ruby-beginner-en-1o8Mb/3/5?curriculum_id=5059f8619189a5000201fbcb#


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 
end
square(40)


#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.


#3

Are you returning or printing? Is there a difference?


#4

ive managed ot correct the issue. thanks


#5

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