'For' loops are rarely used in Ruby. Whenever possible, use '.each'. In this case that would look like: 
(1..num).each do 
end