0
I have the following problem:
lista1 = [3,4,5]
list(map(lambda x: x**3, lista1))
Made that mistake:
TypeError Traceback (most recent call last)
<ipython-input-14-5e26f3f7b396> in <module>()
2 lista1 = [3,4,5]
3 lista2 = (map(lambda x: x**3, lista1))
----> 4 print(list(lista2))
TypeError: 'list' object is not callable
Could someone explain to me why I made a mistake?
Could you put in the full code, please?
– Woss
@Andersoncarloswoss that’s the full code I run it on the notebook jupyter!
– Rafael Silva
The code, as posted, no errors, so you must have run other things before, including setting a variable called
list
somewhere, overwriting the structurelist
Python standard, causing error.– Woss
@Andersoncarloswoss solved the problem by making a Restart in the notebook jupyter kernel
– Rafael Silva
@Rafaelsilva take advantage and create an answer with your solution so that when someone has the same problem, learn how to fix it too.
– fernandosavio
In my case I was using the notebook jupyter and just doing the kernel Restart and everything started working.
– Rafael Silva
@fernandosavio the answer was created.
– Rafael Silva
Very good. Would you be able to add the command used to do this? I would do this, but since I don’t work much with Jupyter I don’t know how you do it.
– fernandosavio
And you can mark your answer as the correct one.
– fernandosavio