[1,2,3,4].each_with_index do |element, i| puts "#{element}, #{i}" end