Whose Error Is It?

Python printed this

TypeError: 'NoneType' object is not subscriptable
What it meansYou tried to index or slice a value that is None, so the variable you expected to hold a list or dict actually holds nothing.
The first thing to checkUsually a function returned None implicitly or a lookup found nothing; check where the variable was assigned and guard for None before indexing it.
The walrus saysNone is not a dictionary, no matter how hard you subscript it.

More from Python

All 75 errors

Whose Error Is It? · Status Menu · Back to the bar