函索调用-时间引入表示

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

执行结果:

父亲名字 张 0.1秒显示

儿子名字 王 1秒显示

孙子名字 赵1.5秒显示




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