一、Python中的运算符的特殊之处
** | 幂运算 | 3 ** 2 |
// | 取整:返回两个数相除后商的整数部分 | 10 // 3 |
二、执行Python程序的三种方式
2.1 解释器
#使用python 2.x解释器
python xxx.py
#使用python 3.x解释器
python3 xxx.py
2.2 交互式运行
进入解释器方式:
#windows下 cmd中输入
python/python3
#linux下 终端中输入
python/python3
退出解释器方式:
#python的shell中直接输入
exit()
#使用热键退出,按热键ctrl+d可以退出
2.3 交互式plus运行——ipython
和官方的交互式shell相比,支持自动补全、自动缩进、支持bash shell命令以及内建函数
进入解释器方式:
#使用python2.x解释器
ipython
#使用python3.x解释器
ipython3
退出解释器方式:
#ipython的shell中直接输入
exit
#使用热键退出,按热键ctrl+d可以退出
三、PyCharm设置
3.1 设置项目使用的解释器版本
File-->Settings-->Project XXX-->Python Interpreter
四、Python注释
4.1单行注释
#这是一个单行注释
"""
这是一个多行注释
"""
五、官方学习网站
PEP:https://www.python.org/dev/peps/pep-0008/
谷歌中文文档:https://zh-google-styleguide.readthedocs.io/en/latest/google-python-styleguide/python_style_rules/