logo
  • 教程列表
  • SO官方文檔
  • Python 集合
    • 集合上的操作
    • 獲取列表的唯一元素
    • 套裝
    • 使用 Methods 和 Builtins 設定操作
    • 集與多集
  1. StackOverflow 文件
  2. Python Language 教程
  3. Python 集合
  4. 套裝

套裝

Created: November-22, 2018

{{1,2}, {3,4}}

導致:

TypeError: unhashable type: 'set'

相反,使用 frozenset:

{frozenset({1, 2}), frozenset({3, 4})}
  • 使用 Methods 和 Builtins 設定操作
  • 獲取列表的唯一元素

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明