grades = [88, 99, 73, 56, 87, 64] sum = 0 grades.each do |grade| sum += grade end average = sum / grades.length puts average