9. Create Your Own!

Hi community!,

I was wondering if someone can explain to me why the following code:

def greeter

phrase = Proc.new do puts"Hello there!"

puts greeter(&phrase)

The code is printing “Hello there!” as it should but underneath it is also printing the number 21 as well.

Where is this number coming from and what does it mean?

Thanks in advance!

very likely caused by the underlying validation of codecademy, if i run the code outside codecademy it doesn’t display 21.


Thanks, I wasn’t sure if that was the case or me not understanding what I was doing.


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