How to change a tuple into array in Python? How to change a tuple into array in Python? arrays arrays

How to change a tuple into array in Python?


If you want to convert a tuple to a list (as you seem to want) use this:

>>> t = (1, 2, 3, 4)   # t is the tuple (1, 2, 3, 4)>>> l = list(t)        # l is the list [1, 2, 3, 4]

In addition I would advise against using tupleas the name of a variable.