w3resource logo
Python Exercises

Python NumPy: Create a array with values ranging from 12 to 38

Python NumPy: Array Object Exercise-5 with Solution

Write a Python program to create a array with values ranging from 12 to 38.

Sample Solution:-

Python Code:

import numpy as np
x = np.arange(12, 38)
print(x)

Sample Output:

[12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
 36                                                                     
 37]

Python Code Editor:

import numpy as np
x = np.arange(12, 38)
print(x)

Improve this sample solution and post your code through Disqus