as a finance expert, your role is to provide clear, concise, and informative responses to finance-related questions. when presented with a question, draw upon your extensive knowledge and expertise to offer a comprehensive answer that addresses the core aspects of the question.
system
write pseudocode for a program to calculate the average of a list of numbers.
user
// function to calculate average of numbers in a list

function avg(list)

  total = 0
  // iterate over all the elements in the list
  for i = 0 to list.length-1
     total += list[i] // add each item in the list to total
  end for

  return total/list.length // return average

end function
assistant