TypeError: 'dict' object is not callable while using dict( )

前端 未结 3 834
余生分开走
余生分开走 2021-01-18 11:31

I was using Python 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609] on linux2 , when i ran the folllowing code in it the corresponding error is shown .I searche

3条回答
  •  鱼传尺愫
    2021-01-18 12:08

    edit: Ignore this, I am told this is bad practice.

    As mgilson stated, the issue is likely that you have a variable called dict. The solution to this would be to run

    del dict
    

    which deletes the variable by that name.

提交回复
热议问题