Initial commit: Python learning project with examples and exercises

This commit is contained in:
2025-07-20 17:08:50 +08:00
commit bc7bb56271
111 changed files with 11535 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
S = {1,2,3,'a','r','d'}
T = {2,3,4,'f','b','c','f','a'}
print(S-T)
result = S & T
print(result)
print(S&T)
print(S^T)
S ^= T
print(S)
print(S|T)
S|=T
print(S)
print(S<=T)
print(S<T)
print(S>=T)
print(S>T)
S.add(4)
print(S)
S.clear()
print(S)
F=T.copy()
print(F)
x=T.pop()
print(x)
T.discard(2)
print(T)
T.remove(3)
print(T)
print(S.isdisjoint(T))
print(len(S))
print(3 in T)
print(3 not in T)