Exercise 11#
Question 1#
Use one of the functions for creating arrays (along with a possible operation) to generate the following:
[0.0 0.1 0.2 0.3 0.4]
[10 9 8 7 6 5 4 3 2 1]
[5 5 5 5 5]
Question 2#
The NumPy function np.sum
takes an array as an argument and returns a sum of all the items in the array (or along a specified axis in the case of multidimensional arrays).
Use this to calculate the following sums without using loops or list comprehension: