Fork me on GitHub

默认形参 与 关键字实参的区别

# ### 默认形参 与 关键字实参的区别
# 函数的定义处 top middle bottom ... 默认形参
def five_class_xiongda_team(top="黄熊大",middle="黄文",bottom="罗婷",jungle="黄将用",support="王文"):
	print("top上单选手{top}".format(top=top))
	print("middle中单选手{middle}".format(middle=middle))
	print("bottom下路选手{bottom}".format(bottom=bottom))
	print("jungle打野选手{jungle}".format(jungle=jungle))
	print("support辅助选手 最后的希望vip{support}".format(support=support))
# 函数的调用处
# 关键字实参
# five_class_xiongda_team() top middle bottom ... 关键字实参
five_class_xiongda_team(top="黄于正",middle="王俊文",bottom="潘伟成",jungle="张国成")

  

posted @ 2019-05-07 00:21  MR_黄Python之路  阅读(164)  评论(0编辑  收藏  举报