python higher-order function demo

来源:互联网 发布:java通信软件培训 编辑:程序博客网 时间:2024/06/06 00:58
#demo of higher-order functions, passing function as an objectdef do_twice(f, arg):    f(arg)    f(arg)    def print_something(s):    print(s)    do_twice(print_something, 'spam')

0 0