+ 1
Why is this code resulting to NO OUTPUT?
h = {a:2, b:4, c:8} sum = 0 h.each do |k,v| sum += v end
4 Respostas
+ 8
Allan Decker code is correct you just need to print the sum.
h = {a:2, b:4, c:8}
sum = 0
h.each do |k,v|
sum += v
puts sum
end
+ 7
Allan Decker no problem 😊
0
Thank you Gwen it's working
0
[EXPUNGED] answer.
Albert Stuff please don't spam in q/a section continuous action can result in your account deactivation so use this section for asking programming doubts.