Additional output with 'for' loop


#1

Why is the results screen showing the range of numbers I'm outputting as my last result?

for num in 1..20
puts num
end

Outputs 1 thru 20 but final line is '1..20'

Thanks


#2

Hey, that happens because methods (functions) in Ruby return some value.
The evaluated expression 1..20, which is a Range, is returned in your case.