To obtain the average of an array in Python, you can sum all the values in the array and divide by the length of the array. Here's an example:
main.py77 chars6 lines
This will output:
main.py4 chars2 lines
So the average of the my_array
is 6.0
.
gistlibby LogSnag