Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unhasshable type 'list'
#2
SUBJEK is list of lists, so it's not hashable. That is exactly what the error says...

>>> my_list = [[1,2], [3,4]]
>>> set(my_list)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unhashable type: 'list'
I don't see the point of adding set(SUBJEK). i.e. kata is str, elements in SUBJEK are of type list
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


Messages In This Thread
Unhasshable type 'list' - by Piqurs - Jul-20-2018, 11:59 AM
RE: Unhasshable type 'list' - by buran - Jul-20-2018, 12:09 PM
RE: Unhasshable type 'list' - by woooee - Jul-20-2018, 05:12 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  search a list or tuple for a specific type ot class Skaperen 8 1,994 Jul-22-2022, 10:29 PM
Last Post: Skaperen
  TypeError: unsupported opperand type(s) for %: 'int' and 'list' cool_person 7 2,256 May-07-2022, 08:40 AM
Last Post: ibreeden
  unsupported operand type(s) for %: 'list' and 'int' RandomCoder 4 32,948 May-07-2022, 08:07 AM
Last Post: menator01
  You have any idea, how fix TypeError: unhashable type: 'list' lsepolis123 2 3,076 Jun-02-2021, 07:55 AM
Last Post: supuflounder
  What type of *data* is the name of a list/tuple/dict, etc? alloydog 9 4,448 Jan-30-2021, 07:11 AM
Last Post: alloydog
Question dict value, how to change type from int to list? swissjoker 3 2,784 Dec-09-2020, 09:50 AM
Last Post: perfringo
  List items verification for Integer type vintysaw 4 2,935 Jan-17-2020, 01:56 PM
Last Post: perfringo
  Type hinting - return type based on parameter micseydel 2 2,526 Jan-14-2020, 01:20 AM
Last Post: micseydel
  removing quotes from a list and keep type list evilcode1 3 2,358 Aug-03-2019, 11:07 AM
Last Post: perfringo
  please help me TypeError: unsupported operand type(s) for +=: 'int' and 'list' aankrose 2 7,263 Mar-26-2019, 06:00 PM
Last Post: perfringo

Forum Jump:

User Panel Messages

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