Convert array to a python list with same elements using tolist method
suggest changeWhen you need a Python list
object, you can utilize the tolist()
method to convert your array to a list.
my_array = array('i', [1,2,3,4,5])
c = my_array.tolist()
# [1, 2, 3, 4, 5]
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents