Wmo & Co |
|
The beauty of python
Who needs Haskell or any other fp language when you have set comprehension in Python ?
n=48
{ (x,y) for x in range(1,1+int(math.sqrt(n))) for y in range(1,1+n) if (x*y)==n }
{(1, 48), (2, 24), (3, 16), (4, 12), (6, 8)}
ῶ
| |