#下面我们来快速入门Python中的怎样写出自己的函数
#函数
#参数 返回值 函数体
#无参数
def helloworld():
print("hello world")
#调用helloworld()函数
helloworld()
#有参数的函数
def name(name):
print(name)
#未知参数
def future(*items):
for item in items:
print(item)
#调用future函数
future(12,4343,545,"dfs","try it")
#字典与函数
def user(**user):
print(user)
#调用user函数
user(id=1,name="join",age=19)
#将会输出
#{'id': 1, 'name': 'join', 'age': 19}
5-快速入门Python函数使用
最新推荐文章于 2022-05-30 22:08:01 发布