Write a Python program that accepts an array of numbers and returns their sum.
Implement array_sum(nums), where nums is a list of integers or floating-point numbers. Return a single numeric value equal to the sum of every element. An empty array should return 0.
nums, a list of numbersdef array_sum(nums):