“TypeError: 'NoneType' object is not callable” when adding lists to dictionary

前端 未结 3 449
情深已故
情深已故 2021-01-23 20:28

I\'m creating a function that consolidates a couple of lists into a string and am encountering the below error.

Traceback (most recent call last):
  File \"Tradi         


        
3条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-23 21:06

    If you're using Python 3 then first argument to map is ought to be a function. You're passing None so it tries to call a None. This is a different than in Python 2, when None was treated like an identity function (Python's 2 map).

    For Python 2 case see Martijn Pieters's answer.

提交回复
热议问题