Python
Question # 1:
(Filling arrays) Fill a 2-by-3 array with ones, a 3-by-3 array with zeros and a 2-
by-5 array with 7s.
Question # 2:
(Broadcasting) Use arange to create a 2-by-2 array containing the numbers 0–3.
Use broadcasting to perform each of the following operations on the original array:
a) Cube every element of the array.
b) Add 7 to every element of the array.
c) Multiply every element of the array by 2.
Question #3:
(Element-Wise array Multiplication) Create a 3-by-3 array containing the even integers from 2 through 18. Create a second 3-by-3 array containing the integers from 9 down to 1, then multiply the first array by the second.
Question #4:
(array from List of Lists) Create a 2-by-5 array from an argument which is a list of the two five-element lists [2, 3, 5, 7, 11] and [13, 17, 19, 23, 29].
Question #5:
(Flattening arrays with flatten vs. ravel) Create a 2-by-3 array containing the first six powers of 2 beginning with 20. Flatten the array first with method flatten, then with ravel. In each case, display the result then display the original array to show that it was unmodified.