1, Python 中的命名方法
Python 标识符是区分大小写的
命名规则: 小写, 多个单词用_隔开, 在 python 里习惯这种命名方法
驼峰命名法: 每个单词的首字母大写. 剩下的小写, 小驼峰, 大驼峰
2, python 解释器 python 程序运行方式
3, python 注释
4,CPU, 内存, 硬盘
5, 以 PyCharm 为主, 单步执行调试 调试区域, 点击绿色三角按钮, 继续执行
- 6,%s
- #-*-coding:utf-8-*-
- name = 'xiaoming'
- print("我的名字 jiao%s"%name)
- #-*-coding:utf-8-*-
- student_no = 109
- print("我的学号是 %06d"%student_no)
后面一定要加 %name , 不然直接输出的就是 %s
......%f , 其实类似于 C 语言里的形式
- %(name,price)
- %%
- 7,%s
- #-*-coding:utf-8-*-
- scale = 0.25*100
- print("数据比例是 %.2f%%"%scale)
- #-*-coding:utf-8-*-
- scale = 0.25
- print("数据比例是 %.2f%%"%(scale*10))
8, 查询关键字
- #-*-coding:utf-8-*-
- import keyword
- print(keyword.kwlist)
来源: http://www.bubuko.com/infodetail-2979937.html