← go back
They missed a trick
Python 3.12.7 (main, Oct 24 2024, 00:42:48) [Clang 18.0.2 (https://android.googlesource.com/toolchain/llvm-project d8003a456 on linux
>>> {1,2,3} * {4,5,6}
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for *: 'set' and 'set'
>>> {(x, y) for x in {1,2,3} for y in {4,5,6}}
{(2, 4), (3, 4), (1, 5), (1, 4), (2, 6), (3, 6), (1, 6), (2, 5), (3, 5)}
>>>
Cartesian product in Python 3.17? (probably not)
Feb 12, 2025, 1:40 AM
(edited)
1 0 0
Comments