"object is unsubscriptable" What does it means?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • peachdot
    New Member
    • Aug 2010
    • 20

    "object is unsubscriptable" What does it means?

    Just wondering..what should i do if this error came out?
  • bvdet
    Recognized Expert Specialist
    • Oct 2006
    • 2851

    #2
    It means you have attempted to read an index or slice of a non-sequence type object. Example:
    Code:
    >>> 1[1]
    Traceback (most recent call last):
      File "<interactive input>", line 1, in ?
    TypeError: unsubscriptable object
    >>> [1,2,3][1]
    2
    >>>

    Comment

    Working...