Created
June 6, 2014 06:42
-
-
Save mutsune/538a714e54d075be2d8b to your computer and use it in GitHub Desktop.
Python で制御構造っぽいものを定義
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def repeat(n): | |
def _repeat(f, *args): | |
[ f(*args) for i in xrange(n)] | |
return _repeat | |
def _print(text): | |
print text | |
repeat(10)(_print, "hoge") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment