Loops

times, each, while.

times, each, while.

Goal

Puts each city and a running total.

["Nairobi", "Mombasa", "Kisumu"].each do |city|
  puts city
end
total = 0
5.times do |i|
  total += i + 1
  puts "#{i + 1} #{total}"
end
units = [12, 8, 5]
i = 0
while i < units.length
  puts units[i]
  i += 1
end
["Nairobi", "Nakuru", "Eldoret"].each do |city|
  break if city == "Nakuru"
  puts city
end