How to Convert Array to List in Python
![how to convert array to list in python](https://pythonpoint.net/wp-content/uploads/2020/12/how-to-convert-array-to-list-in-python-1024x576.jpg)
In this article, we will see how to convert an array to list in Python
For this, we are using the built-in function in array module. The tolist()
will convert the array to list without loosing any items.
from array import * def array_list(arr): new_list = arr.tolist() #list print(new_list) array = array('i', [54, 12, 543, 212]) #array array_list(array)
Output:
[54, 12, 543, 212]
Subscribe
Login
Please login to comment
0 Discussion