python中的函数的执行分类

author:headsen  chen

date: 2018-03-21  17:42:13

notice:This  article created by headsen chen himself and not allowed to copy,or you will count law question and to  pay 10000$!!! 

1,直接调用函数名的执行:

2,在return中的执行:

执行结果如下:

3,在print里面执行1:不带参数的单一函数执行:print(f())

结果如下:

4,在print里面执行2:带参数的高阶函数:print(f(a))

结果如下:

5,赋值执行1:不带参数的函数赋值执行:b =f()

执行结果:

6,赋值执行2:带参数的赋值执行:b=f(a)

 

执行结果如下:

原文地址:https://www.cnblogs.com/kaishirenshi/p/8618554.html