TypeError: 'list' object is not callable in python

前端 未结 11 1575
醉梦人生
醉梦人生 2020-11-22 13:11

I am novice to Python and following a tutorial. There is an example of list in the tutorial :

example = list(\'easyhoss\')

Now

11条回答
  •  盖世英雄少女心
    2020-11-22 13:56

    In the league of stupid Monday morning mistakes, using round brackets instead of square brackets when trying to access an item in the list will also give you the same error message:

    l=[1,2,3]
    
    print(l[2])#GOOD
    print(l(2))#BAD
    

    TypeError: 'list' object is not callable

提交回复
热议问题