'NoneType' object is not subscriptable?

前端 未结 6 1358
深忆病人
深忆病人 2020-12-05 18:46
list1 = ["name1", "info1", 10]
list2 = ["name2", "info2", 30]
list3 = ["name3", "info3", 50]
MASTERLIST =         


        
6条回答
  •  难免孤独
    2020-12-05 19:19

    The print() function returns None. You are trying to index None. You can not, because 'NoneType' object is not subscriptable.

    Put the [0] inside the brackets. Now you're printing everything, and not just the first term.

提交回复
热议问题