(Sep-26-2020, 07:44 AM)syafiq14 Wrote: TypeError: 'NoneType' object is not subscriptable
The error is self-explanatory. You are trying to subscript an object which you think is a list or dict, but actually is None (i.e: the object has no value). This means that you tried to do:
None[something]
Here you attempted to index an object that doesn’t have that functionality. You might have noticed that the method sort() that only modify the list have no return value printed – they return the default None. This is a design principle for all mutable data structures in Python.
This ‘NoneType’ object is not subscriptable is the one thrown by python when you use the square bracket notation object[key] where an object doesn’t define the getitem method.
buran write Sep-19-2022, 07:06 AM:
Necroposting with sole purpose to advertise your site is not acceptable. Link removed.
Necroposting with sole purpose to advertise your site is not acceptable. Link removed.