set清除所有元素的方法真的是clear()吗?为啥我在其他地方尝试显示报错
name_set = set(['Jenny', 'Ellena', 'Alice', 'Candy', 'David', 'Hally', 'Bob', 'Isen', 'Karl']) print(name_set) name_set.clear() print(name_set)
name_set = set(['Jenny', 'Ellena', 'Alice', 'Candy', 'David', 'Hally', 'Bob', 'Isen', 'Karl']) print(name_set) name_set.clear() print(name_set)
2021-12-16
举报