jeudi 3 décembre 2015

If shorten, python recursion

i try to write a short golf code without using letters "eiou" and i found that (a,b)[conditions] is equal to if statement, but i have no idea why it doesn't work.

a_factaral=lambda x:(a_factaral(x-1)*x,1)[x==0]

Please for some tips

Aucun commentaire:

Enregistrer un commentaire