5. Parameters and arguments


I am stuck here and this code isn't working;

def cubertino (8)
puts = n ** 8


Error code
Oops, try again. Make sure to call cubertino and pass it the number 8 as an argument.

What is the solution?

Replace this line with your code.



(I am have not done Ruby before) - but doing python, I recognized the wording in the instructions -

If you look at the examples given in this lesson -

If a method takes arguments, we say it accepts or expects those arguments.
We might define a function, square, like so:

def square(n)
puts n ** 2

and call it like this:


The solution would be -

def cubertino(n)
puts n ** 3

Hope that helps.


yes it does and it works. Thanks.


Awesome dude.
Good luck for the next lessons.



If you feel that your answer was solved, do not forget to mark it as such.
It will help others who might have experienced the same problem you had.



Yes, have done so.
I would be glad to help others later as well.
For now I am a beginner without any programming experience and working on some fingergespitzengefuhl.


Thanks. Try helping others now. With the lessons you do understand. I found that explaining it to others I actually learnt more. Found new challenges as well.
Good luck with the coding.


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