函数嵌套2-名字练习

#!/usr/bin/python
# coding utf-8
def father (name):
print('父亲名字 %s' %name)
def son(name2):
print('儿子名字 %s'%name2)
def grandson(name3):
print('孙子名字 %s' %name3)
grandson('赵')
son('王')

father('张')


执行结果:

父亲名字 张
儿子名字 王
孙子名字 赵

原文地址:https://www.cnblogs.com/huangjinshan/p/6144524.html