3 ms·
Correct. This is called orthogonality. I just used it now to discover that this same syntax works for both sets and lists (using * instead of ) >>> s1 = {'
by ericfrederich 9y ago
Correct. This is called orthogonality. I just used it now to discover that this same syntax works for both sets and lists (using * instead of )
>>> s1 = {'a', 'b', 'c'}
>>> s2 = {1, 2, 3}
>>> {*s1, *s2}
{'b', 1, 2, 3, 'c', 'a'}
>>> l1 = ['a', 'b', 'c']
>>> l2 = [1, 2, 3]
>>> [*l1, *l2]
['a', 'b', 'c', 1, 2, 3]