函数的嵌套调用|疫情期间日更(15)

函数的嵌套调用
一个函数里面,又调用了另外一个函数函数,就是函数的嵌套调用

def test1():
    return("*" * 10)
print(test1())

输出结果为:

**********
def test1():
    return("*" *10)
def test2():
    print("+" *10)
    print(test1())
    return("-" *10)
print(test2())

输出结果为:

++++++++++
**********
----------
发布了17 篇原创文章 · 获赞 12 · 访问量 2196

猜你喜欢

转载自blog.csdn.net/xiaoyun5555/article/details/104679415