随机移除集合中任意元素。
set.pop()复制
set.pop()
def test(): arr={"a","b","c"} # 随机移除一个元素 arr.pop() print(arr) # 再随机移除一个元素 arr.pop() print(arr)复制
def test():
arr={"a","b","c"}
# 随机移除一个元素
arr.pop()
print(arr)
# 再随机移除一个元素