摘要: 变量可以指向函数,函数的参数能接受变量。那么一个函数就可以接收另一个函数作为参数,这两种函数就称之为高阶函数。 def add(x,y,f): return f(x)+f(y) res=add(3,-6,abs) print(res) 阅读全文
posted @ 2020-02-06 23:07 奔腾的小河 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 1、函数的返回值。python返回值比较诡异。呵呵,我人也可以返回,其它的函数,这时会返回函数的内存地值。如return test1. 1 def test1(): 2 print("in the test1") 3 #print("in the test") 4 5 def test2(): 6 阅读全文
posted @ 2020-02-06 01:04 奔腾的小河 阅读(602) 评论(0) 推荐(0) 编辑