Write a method to display the average of a given array.
Implement def average_array(nums):, where nums is a non-empty list of integers or floating-point numbers. Return the arithmetic mean as a number. The result may be an integer or floating-point value, and the input array must not be modified.
def average_array(nums):