Python TypeError: unhashable type: 'list'

Поделиться
HTML-код
  • Опубликовано: 4 ноя 2024

Комментарии • 6

  • @5-minutepython
    @5-minutepython  2 года назад +1

    Hashable : int , float , str , tuple , and Booleans
    Unhashable : set,list and dict
    Guys, if this video is useful, Please make sure to like or comment this video to continue this Error Solving playlist ( ruclips.net/video/VYecxRO9oaI/видео.html ).Your support is must.

  • @DhavalAhir10
    @DhavalAhir10 9 месяцев назад

    A = set() #Empty Set
    element = (5, 6, [ "Apple" ])
    A.add(element)
    TYPEERROR : unhashable type list.
    The reason is tuple is immutable but in our case tuple element variable is not immutable.
    We can access element[2] and then element[2].append("banana")
    So when we are adding this the list inside tuple cannot be a hashable.

  • @a7medmostafaabuhatab
    @a7medmostafaabuhatab 2 года назад

    Nice, continue

  • @nandakishoremolleti988
    @nandakishoremolleti988 2 года назад +1

    👏