Python Language Set
Jump to navigation
Jump to search
Internal
TODO
- TO PROCESS PyOOP "Sets"
Overview
Initialization
Set from a tuple:
s = set((1, 2, 3))
Set from a list:
s = set([1, 2, 3])
Set from a string:
s = set('ABC')
print(s) # {'C', 'B', 'A'}
Shallow Copy
s = set()
s.add('a')
s2 = s.copy()