您需要 登录 才可以下载或查看,没有账号?立即注册
set1 = frozenset([1, 2, 3, 5]) set2 = {1, 3, 2, 5} print(set1 == set2) # 下面则不可创建集合 try: set3 = {[1, 2, 3, 5]} except Exception as e: print(e) try: set1.add(4) # set1不可变更 except Exception as e1: print(e1) set2.add(8) set2.remove(3) print(set2) set4 = {1, 1.0} print(set4)
使用道具 举报
本版积分规则 发表回复 回帖后跳转到最后一页
小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)
GMT+8, 2025-1-18 07:30
Powered by Discuz! X3.4
© 2001-2023 Discuz! Team.