
运行结果:
- def weather(time,temp): # 定义有参函数weather ,有形参time,temp
- print("*"*13) # 输出13个星号
- print("日期:%s"%time) # 输出日期
- print("温度:%s"%temp) # 输出温度
- print("*"*13) # 输出13个星号
- weather("4月12日","10-14度") # 调用weather()函数,里边有2个实参
*************
日期:4月12日
温度:10~14度
*************