Python program to create 1D array of elements and find odd/even numbers
1D(single Dimensional) array is a collection of similar elements. Let us create a 1D array of elements in python as follows…. Creation of 1D array from 1 to 20: This program starts from import the built-in file “numpy” and create an object for numpy as np. Create an array as s_arr. Using the function “arange()” to assign the size. Here, we set the range as 20 members. Finally, print the array elements using print() function. Python Code: import numpy as np # Create a 1D(single dimensional) array from 1 to 20 s_arr = np.arange(1, 21) print("Here is the 1D Array:\n", s_arr) Output: Here is the 1D Array: [ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20] Print Even numbers in the array: This program imports the numpy, the built-in file. It creates the object for n...