python笔记-010-函数(下)
来源:互联网 发布:阿里巴巴农村淘宝兰西 编辑:程序博客网 时间:2024/06/06 20:52
# ★使用任意数量的关键字实参def build_profile(first, last, **user_info): """创建一个字典,其中包含我们知道的有关用户的一切""" profile = {} profile['first_name'] = first profile['last_name'] = last for key, value in user_info.items(): profile[key] = value return profileuser_profile = build_profile('albert', 'einstein', location='princeton', field='physics')print(user_profile)# ★形参**user_info中的两个星号让Python创建一个名为user_info的空字典# ★将函数存储在模块中:import语句
阅读全文
0 0
- python笔记-010-函数(下)
- linux下python学习笔记(七)函数1
- linux下python学习笔记(八)函数2
- Python笔记(函数)
- 函数(python笔记)
- Python学习笔记(函数)
- python学习笔记(函数)
- python学习笔记(函数)
- Python笔记(十四)--函数
- Python学习笔记(十一):Python函数
- Python学习笔记(三)--Python函数
- 【python学习笔记】实现linux终端下的getch()函数
- Python学习笔记:Python函数
- python学习笔记(二):递归函数
- Python自学笔记(四)函数
- Python自学笔记(五)Lambda函数
- python学习笔记(二)之函数
- python学习笔记(4)-- 函数
- Maven仓库的布局、分类
- ajax消息通信,单文件上传和多文件上传的前后端实现
- Hibernate——SessionFactory产生session的两种方法
- BOS 第一天 maven ssh
- 架构师之路(四)
- python笔记-010-函数(下)
- Climbing Stair爬楼梯算法详解
- 架构师之路(五)
- 【人工智能】图像识别之小白天书——验证码篇(5)
- 关于阿里云Centos服务器搭建Java网站不能访问的问题
- Okhttp3问题 Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported
- 数据库分区表关联
- 大数据平台安装部署文档 Ambari2.4-HDP2.5
- 解构、参数默认值,不定参数,拓展参数、for of 值遍历