# 函数中的内部函数不能在外部单独调用,但类可以
def jisuanqi(x, y):
def plus(a, b):
c = a + b
print(f"{a}+{b}={c}")
plus(x, y)
def devide(a, b):
c = a // b + 0.8 * a + b * b * b - a * b
print(f"{a}和{b}通过复杂的计算,得出了{c}")
devide(x, y)
jisuanqi(11, 4)
class JISUAN:
def plus(self, a, b):
c = a + b
print(f"{a}+{b}={c}")
def devide(self, a, b):
c = a // b
print(f"{a}//{b}={c}")
cc = JISUAN()
cc.plus(2, 5)
cc.devide(9, 4)