课时27 4.5:函数

"""
程序开头注释
author: xingbuxing
date: 2018年01月11日
功能:本程序主要介绍python的函数
"""


# # =====基本函数的定义
# def print_h(str_var='hello world'):
#     # 以下是函数内容
#     # 函数的功能:将str_var变量打印出来
#     print str_var
#
# # 以def开头
# # print_h是函数名
# # str_var是参数,可以带上默认参数
# # 函数首行的最后需要带上冒号
#
#
# # =====调用函数
# print_h()
# print_h(str_var='你好,世界')
posted @ 2019-12-25 10:32  Johnson蚂蚁  阅读(180)  评论(0编辑  收藏  举报