Wednesday, 18 September 2013

'NoneType' object is not subscriptable?

'NoneType' object is not subscriptable?

list1 = ["name1", "info1", 10]
list2 = ["name2", "info2", 30]
list3 = ["name3", "info3", 50]
MASTERLIST = [list1, list2, list3]
def printer(list):
print ("Available Lists:")
listlen = (len(list))
for x in range(listlen):
print (list[x])[0]
This code is returning the --'NoneType' object is not subscriptable--
error when I try and run printer with MASTERLIST. What did I do wrong?

No comments:

Post a Comment