Back
For creating an array, you have to use the NumPy package. First, you have to import the package in Python using the following:
import numpy as npa=np.array([2,3,4,5,6])a
import numpy as np
a=np.array([2,3,4,5,6])
a
The output:
array([2, 3, 4, 5, 6])
If you are looking for an online course to learn Python, I recommend this Python Course by Intellipaat.
31k questions
32.8k answers
501 comments
693 users