Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (50.2k points)
Can anyone tell me how to create an array in Python?

1 Answer

0 votes
by (108k points)

For creating an array, you can use the NumPy package. First of all, you should import the package in Python:

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 Online Course program by Intellipaat.

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Oct 11, 2019 in Python by Sammy (47.6k points)
0 votes
2 answers

Browse Categories

...