-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathW3 School set.py
78 lines (58 loc) · 1.28 KB
/
W3 School set.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
toys = {"gun", "ball", "bat"}
toys.add("Teddy")
print(toys)
toys = {"gun", "ball", "bat"}
toys.clear()
print(toys)
toys= {"gun", "ball", "bat"}
x = toys.copy()
print(x)
x = {"gun", "ball", "bat"}
y = {"AC", "cooler", "fan"}
z = x.difference(y)
print(z)
toys = {"gun", "ball", "bat"}
toys.discard("ball")
print(toys)
x = {"gun", "ball", "bat"}
y = {"AC", "cooler", "fan"}
z = x.intersection(y)
print(z)
x = {"gun", "ball", "bat"}
y = {"AC", "cooler", "fan"}
x.intersection_update(y)
print(x)
x = {"gun", "ball", "bat"}
y = {"AC", "cooler", "fan"}
z = x.isdisjoint(y)
print(z)
x = {"a", "b", "c"}
y = {"f", "e", "d", "c", "b", "a"}
z = x.issubset(y)
print(z)
x = {"f", "e", "d", "c", "b", "a"}
y = {"a", "b", "c"}
z = x.issuperset(y)
print(z)
toys = {"ball", "bat", "gun"}
toys.pop()
print(toys)
toys = {"ball", "bat", "gun"}
toys.remove("gun")
print(toys)
x = {"apple", "banana", "cherry"}
y = {"google", "microsoft", "apple"}
z = x.symmetric_difference(y)
print(z)
x = {"gun", "ball", "bat"}
y = {"AC", "cooler", "fan"}
x.symmetric_difference_update(y)
print(x)
x = {"gun", "ball", "bat"}
y = {"AC", "cooler", "fan"}
z = x.union(y)
print(z)
x = {"gun", "ball", "bat"}
y = {"AC", "cooler", "fan"}
x.update(y)
print(x)