Pythonの再帰ラムダでピラミッドを建造した
「不動点コンビネータ」とは
Pythonのlambda式で再帰をやるには「不動点コンビネータ」を使うと良いと聞き、言葉の響きがかっこいいので実装した。不動点???
print(lambda f:f("#\n",f))(lambda s,f:s if len(s)>99 else " "*int(50-len(s)/2)+s+f("#"*4+s,f))
様子
Author And Source
この問題について(Pythonの再帰ラムダでピラミッドを建造した), 我々は、より多くの情報をここで見つけました https://qiita.com/HiuNaoki/items/2e1c41e880140ac145bf著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .