函数的嵌套调用

在函数的内部调用其他的函数

def index():

  func()

  print("index")

def func():

  index()

# def index():
# func()
# print("index")
#
# def func():
# print("func")
# index()

#
def my_max(x,y):
#这个函数的作用就是比大小谁大打印出来的就是谁
if x > y:
return x
return y
def my_max2(a,b,c,d):
res = my_max(a,b)
res1 = my_max(res,c)
res2 = my_max(res1,d)
return res2
print(my_max2(1,2,9,5))
原文地址:https://www.cnblogs.com/yangxinpython/p/11164429.html