How can we define an array in Python?
If you want to work with an array in python, you will have to import a library like NumPy Library.
NumPy is a Python Library. It is used to working with arrays.
If you want to use NumPy Library, Firstly install NumPy using this command
pip install numpy
- import numpy
- arr = numpy.array([1,2,3])
- Print(arr)
you can import numpy as np, Instead of import numpy
Comments
Post a Comment