Created
May 7, 2009 22:36
-
-
Save seungjin/108441 to your computer and use it in GitHub Desktop.
// get rid of for/while in your python
This file contains hidden or 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
#!/usr/bin/env python | |
# get rid of for/while in your python code! | |
def loop(givenF,a,b): | |
if ( a >= 0 and b >= a) : | |
givenF() | |
a += 1 | |
loop(givenF,a,b) | |
def sayHello(): | |
print("say hello") | |
loop(sayHello,1,4) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment