Monthly Archives: July 2019

Recursions in Python 3.8

In Python 3.8 we can finally write short recursive functions: >>> (fac := lambda n: (1 if n<2 else n*fac(n-1))) <function <lambda> at 0x000001AFD258D550> >>> fac(4) 24>>> (fac := lambda n: (1 if n<2 else n*fac(n-1))) <function <lambda> at 0x000001AFD258D550> … Continue reading

Posted in General | Leave a comment