Help ruby


#1



11 Use the code blocks

My code is not working :frowning:
I fail to do so, can someone help me to resolve this exercice ?
ps : sorry for my english

"For now, the second will each view 5 five liver ( there will worm pay 5 elements of the table , and there are five elements). Change the block to Let Each table displays the Elements MULTIPLIE by five" .

# Le block {|i| puts i} est évalué pour chaque  
# item du tableau. Ce block affiche les items. 
[1, 2, 3, 4, 5].each { |i| puts i }

# Ce block affiche le nombre 5 pour chaque item.
[1, 2, 3, 4, 5].each { |i| puts i**5 }


#2

** isn't the multiplication operator!

Watch what happens if I run 3 ** 5:

$ irb
> 3 ** 5
243
> 3 * 3 * 3 * 3 * 3
243

#4

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