#函数嵌套:
#1 函数的桥套调用:在调用一个函数的过程中又调用其他函数
# def max2(x,y):
# if x> y:
# return x
# else:
# return y
#
#
#
# def max(a,b,c,d):
# #第一步:比较 a b 得到res1
# res1=max2(a,b)
#
# #第二步:比较res1,c 得到res2
# res2 = max2(res1, c)
#
# #第三步:比较res2 d 得到res3
# res3=max2(res2,d)
#
# return res3
#2 定义.在函数内定义其他函数
# def f1():
# def f2():
# pass
#
#圆形
#求周长: 2 * pi * radius
def circle(radius,action=0):
from math import pi
def perimiter(radius):
# return 2*pi*radius
print(f'圆的周长是:{2*pi*radius}')
#求面积:pi * (radius**2)
def area(radius):
# return pi*(radius ** 2)
print(f'圆的面积是:{radius ** 2}')
if action == 0:
return perimiter(radius)
elif action == 1:
return area(radius)
# res=circle(33,action=0)
# print(res)
circle(33,action=1)