Created
August 1, 2017 03:35
-
-
Save swshan/7e48a15965f9f74845df7935d3163e5f to your computer and use it in GitHub Desktop.
回调函数 demo
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
#coding=utf-8 | |
def double(x): | |
return x*2 | |
def getoddnum(k, getEvenNumber): | |
return 1 + getEvenNumber(k) | |
def main(): | |
k = 1 | |
i = getoddnum(k, double) # 2k+1 | |
print (i) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment