Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
TypeError: 'list' object is not callable
-
my_list=[1,2,3,4,5,6,7,8,9,10] even= list(filter(lambda x : x%2 == 0,my_list)) print(even)
Why does the above code show TypeError: 'list' object is not callable ?(run with Pythonista 3.6)
-
@Anik works for me, sure you run in Python 3?
Edit : works also in Python 2.6
Prints
[2, 4, 6, 8, 10]
Edit2: sure that these 3 lines of code do not belong to a bigger script where a variable is called list?
-
Thank you for your response.
This code run with python 2.7.
But why does this code show TypeError with python 3.6? -
@Anik For me, this code runs ok in Python 3.6
Did you see my previous question? Is this little code part of a bigger one or do you try these 3 lines alone? -
3 lines alone.
-
@Anik Sorry but I can't find an explanation. Did you try to remove Pythonista from memory and restart?
-
Works as expected for me.