s1 = set([1, 2, 3, 4, 5])
s2 = set([1, 2, 3, 4, 5, 6, 7, 8, 9])
if s1.isdisjoint(s2)==False:
for numbers_overlap in s1:
if numbers_overlap in s2:
print(numbers_overlap)
#so if there are numbers(numbers_overlap) in s1 found in set 2, print the numbers_overlap
s2 = set([1, 2, 3, 4, 5, 6, 7, 8, 9])
if s1.isdisjoint(s2)==False:
for numbers_overlap in s1:
if numbers_overlap in s2:
print(numbers_overlap)
#so if there are numbers(numbers_overlap) in s1 found in set 2, print the numbers_overlap
2023-09-28
L = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
S = set([1, 3, 5, 7, 9, 11])
# if ( item_L) is in S, it should be deleted from set, if not, it should be added into set.
for item_L in L:
if item_L in S:
S.remove(item_L)
else:
S.add(item_L)
print(S)
S = set([1, 3, 5, 7, 9, 11])
# if ( item_L) is in S, it should be deleted from set, if not, it should be added into set.
for item_L in L:
if item_L in S:
S.remove(item_L)
else:
S.add(item_L)
print(S)
2023-09-28
L = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
S = set([1, 3, 5, 7, 9, 11])
for i in L:
S1 = S
S1.add(i)
if S != S1:
S.add(i)
S1.remove(i)
else:
S.remove(i)
print(S)
S = set([1, 3, 5, 7, 9, 11])
for i in L:
S1 = S
S1.add(i)
if S != S1:
S.add(i)
S1.remove(i)
else:
S.remove(i)
print(S)
2023-09-19
names= [ 'Alice' ,'Bob','Candy','David','Ellena' ]
names.append('Zero')
names.insert(-2'phoebe')
names.insert(-3'Gen')
prent(names)
names.append('Zero')
names.insert(-2'phoebe')
names.insert(-3'Gen')
prent(names)
2023-09-13
a = 'python'
print('hello,', a or 'world')
b = ''
print('hello,', b or 'world')
print('hello,', a or 'world')
b = ''
print('hello,', b or 'world')
2023-08-25