python零零碎碎
2016-01-31 19:43
435 查看
函 数的参数里一旦开始使用了关键字,如上面的stuid,接下来就必须接着使用,否则会报错。
def myFunc(stuid = 1352849 ,name = 'lsm' , sex = 'f'): print (stuid,name,sex) #correct myFunc() myFunc(1352944) myFunc(1352944,'gjq') myFunc(1352944,'gjq','m') # non-keyword argument after a keyword argument myFunc(stuid = 1352944,'gjq')
相关文章推荐
- python读取文件的方法
- JuPyter(IPython) Notebook中通过pip安装第三方Python Module
- Head Frist Python 读书笔记 列表推导(list comprehension)
- 学习Python语言---模块
- 学习Python语言---函数
- 萌妹子Python入门指北(二)
- python面向对象编程基础
- Head Frist Python 读书笔记 第4章 “腌制”数据
- Python基础:深浅拷贝
- python 的模块导入
- python判断字符串编码——使用chardet判断字符串编码的方法
- wxPython 控件
- Python2.x和Python3.x的区别
- Python笔记之基本的语法
- Python注释
- Python基础:元组
- Python 模块的发布与上传
- wxPython大全
- 通过进程名获取该进程所占CPU百分比
- Python with open 使用技巧