Python -Function - TypeError: 'NoneType' object is not subscriptable
<p>I'm making a small function that should sort alphabetically the degreecheme by last name ("also using first name if the last name for 2 persons are the same ) and I stack into the error "TypeError: 'NoneType' object is not subscriptable.</p>

<p>I have never before seen this error, so I have no idea what it means.</p>

<pre><code>def degreescheem(listing,x): 
printed=False
temporlist=[]
for i in listing: 
if i[3] == x :temporlist.append(i)
slist=sorted(temporlist,key=lambda s:(s[4],s[5]))
for j in slist :
    informationsformat(j)
    printed = True
if not printed: print("no",x)
</code></pre>

<p>also it says that the error  here is if i[3] == x :temporlist.append(i) but i cant found out something!!</p>