Python Forum

Full Version: Conver to List
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am playing to convert a tuple to a list. I thought using list() is simple, but not...What's wrong?


aTuple = (123, 'xyz', 'zara', 'abc');
aList = list(aTuple)
print ("List elements : ", aList)
Output:
------------------
aList = list(aTuple)
TypeError: 'list' object is not callable

I am using Python 3.5 with Eclipse
You must of previously before this written over python's built-in list such as in this example

>>> list
<class 'list'>
>>> list = list('abc')
>>> list
['a', 'b', 'c']
>>> example = list('uh-oh')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'list' object is not callable