Python Forum
TypeError: 'NoneType' object is not subscriptable
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TypeError: 'NoneType' object is not subscriptable
#7
The error is self-explanatory. You are trying to subscript an object which is a None actually...

Example 1

list1=[5,1,2,6]   # Create a simple list
order=list1.sort()  # sort the elements in created list and store into another variable.
order[0]  # Trying to access the first element after sorting

TypeError     Traceback (most recent call last)

in ()
  list1=[5,1,2,6]
  order=list1.sort()
----> order[0]
Reply


Messages In This Thread
RE: TypeError: 'NoneType' object is not subscriptable - by DigiTMG - Sep-08-2020, 10:03 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Merge htm files with shutil library (TypeError: 'module' object is not callable) Melcu54 7 3,490 Mar-09-2025, 04:25 PM
Last Post: Pedroski55
Question TypeError: argument of type 'NoneType' is not iterable Tajaldeen 7 2,763 Nov-29-2024, 09:45 AM
Last Post: Tajaldeen
  I am getting this TypeError: 'TreasureMap' object is not subscriptable. makilakos 2 1,295 May-25-2024, 07:58 PM
Last Post: deanhystad
  TypeError: cannot pickle ‘_asyncio.Future’ object Abdul_Rafey 1 2,853 Mar-07-2024, 03:40 PM
Last Post: deanhystad
  error in class: TypeError: 'str' object is not callable akbarza 2 1,846 Dec-30-2023, 04:35 PM
Last Post: deanhystad
Bug TypeError: 'NoneType' object is not subscriptable TheLummen 4 3,798 Nov-27-2023, 11:34 AM
Last Post: TheLummen
  TypeError: 'NoneType' object is not callable akbarza 4 14,649 Aug-24-2023, 05:14 PM
Last Post: snippsat
  [NEW CODER] TypeError: Object is not callable iwantyoursec 5 5,856 Aug-23-2023, 06:21 PM
Last Post: deanhystad
  Python: Regex is not good for re.search (AttributeError: 'NoneType' object has no att Melcu54 9 3,746 Jun-28-2023, 11:13 AM
Last Post: Melcu54
  TypeError: 'float' object is not callable #1 isdito2001 1 1,962 Jan-21-2023, 12:43 AM
Last Post: Yoriz

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020