i=0numbers=[]whilei<6puts"At the top i is #{i}"numbers.push(i)i+=1puts"Numbers now: ",numbersputs"At the bottom i is #{i}"endputs"The numbers: "# remember you can write this 2 other ways?numbers.each{|num|putsnum}
defzero_to_n(n)@numbers=[]foriin(0...n)puts"At the top i is #{i}"@numbers.push(i)puts"Numbers now: ",@numbersputs"At the bottom i is #{i}"endendputs"Please input a number:"n=$stdin.gets.chomp.to_izero_to_n(n)puts"The numbers: "# remember you can write this 2 other ways?@numbers.each{|num|putsnum}