Python 集合
集合
集合是一个无序的、不可更改的、无索引的集合。
在 Python 中,集合是用大括号编写的。
实例
Create a Set:
thisset = {"apple", "banana", "cherry"}
print(thisset)
注意:集合是无序的,所以你不能确定项目将以何种顺序出现。
集合是一个无序的、不可更改的、无索引的集合。
在 Python 中,集合是用大括号编写的。
Create a Set:
thisset = {"apple", "banana", "cherry"}
print(thisset)
注意:集合是无序的,所以你不能确定项目将以何种顺序出现。