Python Forum
Float Object is not Subscriptable
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Float Object is not Subscriptable
#1
I have this object:

a=(994.7, <__main__.bit object at 0x7f35b7f2c220>)
And I am trying to get just 994.7 so I am using this:
a[0][1]
But I have float object is not sunbscriptable error

HOw can I solve the problem?
Reply
#2
From what you show a is a tuple. so just a[0]
quest likes this post
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
(Apr-20-2021, 09:13 AM)buran Wrote: From what you show a is a tuple. so just a[0]

thanks!!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Bug TypeError: 'NoneType' object is not subscriptable TheLummen 4 679 Nov-27-2023, 11:34 AM
Last Post: TheLummen
  TypeError: 'float' object is not callable #1 isdito2001 1 1,045 Jan-21-2023, 12:43 AM
Last Post: Yoriz
  Help with python 'not subscriptable' error Extra 3 1,978 Dec-16-2022, 05:55 PM
Last Post: woooee
  TypeError: 'float' object is not callable TimofeyKolpakov 3 1,373 Dec-04-2022, 04:58 PM
Last Post: TimofeyKolpakov
  TypeError: 'NoneType' object is not subscriptable syafiq14 3 5,166 Sep-19-2022, 02:43 PM
Last Post: Larz60+
  'int' object is not subscriptable after API call ed8484 1 1,765 Sep-18-2021, 02:06 PM
Last Post: ed8484
  Message='int' object is not subscriptable DanielCook 4 2,263 Aug-10-2021, 05:21 PM
Last Post: deanhystad
  Bool Object is not Subscriptable quest 1 4,086 May-02-2021, 11:12 AM
Last Post: Yoriz
  TypeError: 'NoneType' object is not subscriptable Jmekubo 6 27,223 Sep-08-2020, 10:03 AM
Last Post: DigiTMG
  TypeError: 'type' object is not subscriptable Stef 1 4,441 Aug-28-2020, 03:01 PM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

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