python报错:TypeError: 'int' object is not subscriptable

检查一遍报错的所在行,此报错一般是在整数上加了下标:

比如:

  1.  
    a = 4
  2.  
    c=a[2]

报错:line 2, in <module>
    c=a[2]

TypeError: 'int' object is not subscriptable

再比如复杂一点的:二维

 

posted on 2018-07-27 10:50  乐学习  阅读(23968)  评论(0编辑  收藏  举报

导航