Cubertino initial methods exercise - HELP


#1



https://www.codecademy.com/en/courses/ruby-beginner-en-ET4bU/1/1?curriculum_id=5059f8619189a5000201fbcb


I'm just starting the methods section of the course, and I have to 'call' my method, passing it through an argument. I totally understand this section, and I thought what I've done next is correct, but I get a message saying "Oops, try again. It looks like you didn't print the value of 8 ** 3 to the console."

My code:

def cubertino(n)
puts n ** 3
end

cubertino(2)

The console prints 8, which is what the exercise tells me it should do, but why the error message?! Why would I need to physically type 8**2 when the whole point of the exercise is to not do that and do it by stating the argument at the end?

If someone can explain I would hugely appreciate it!


Replace this line with your code.


#2

CANCEL THAT! I'm an idiot. It said pass it through an argument of 8, not give the answer of 8. DOH. I've changed it to:

def cubertino(n)
puts n ** 3
end

cubertino(8)


#3

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