DAY 6
0

## 集合(Set)

``````data = {range(11)}
data1 = {1,1,1,1,1,2,2,2,2,2,2,3,3,3,3}
data2 = {"appple"}
data3 = set("apple")
print(data)
print(data1)
print(data2)
print(data3)
``````

``````data = {range(11)}
data1 = {1,1,1,1,1,2,2,2,2,2,2,3,3,3,3}
data2 = {"appple"}
data3 = set("apple")
print(type(data))
print(type(data1))
print(type(data2))
print(type(data3))
``````

``````data = {range(11)}
data1 = {1,1,1,1,1,2,2,2,2,2,2,3,3,3,3}
data2 = {"appple"}
data3 = set("apple")
for i in data1:
print(i)
``````

``````data = {range(11)}
data1 = {1,1,1,1,1,2,2,2,2,2,2,3,3,3,3}
data2 = {"appple"}
data3 = set("apple")
for i in data1:
if i >= 2:
print(i)
``````

``````data = {range(11)}
data1 = {1,1,1,1,1,2,2,2,2,2,2,3,3,3,3}
data2 = {"appple"}
data3 = set("apple")
print(1 in data1)
print(4 in data2)
``````

``````data = {range(11)}
data1 = {1,1,1,1,1,2,2,2,2,2,2,3,3,3,3}
data2 = {"appple"}
data3 = set("apple")
print(len(data3))
print(max(data))
print(min(data1))
print(sum(data1))
``````

``````data = {range(11)}
data1 = {1,1,1,1,1,2,2,2,2,2,2,3,3,3,3}
data2 = {"appple"}
data3 = set("apple")
print(data)
print(data1)
print(data2)
print(data3)
print(data)
print(data1)
print(data2)
print(data3)
``````

``````data1 = {1,1,1,1,1,2,2,2,2,2,2,3,3,3,3}
data2 = {"appple"}
data3 = set("apple")
print(data1)
print(data2)
print(data3)
data1.remove(3)
data2.remove("appple")
data3.remove("p")
print(data1)
print(data2)
print(data3)
``````