list.each_with_index { |element,index| print "#{index} #{element}\n" };