Python 源文件:xxxx.py
DOS命令
Tap :在文件夹里,Tap可以补全文件名,多次可以切换文件
python 文件名 :让python翻译给CPU
变量
声明变量实际上就是给内存要空间
python是弱类型:给变量什么类型的值,它就是什么类型,对类型要求不重要
变量名由字母 数字 _组成,不能以数字开头,严格区分大小写,不能使用python的关键字
- 如何查看python的关键字
import keyword
print(keyword.kwlist)
[‘False’, ‘None’, ‘True’, ‘and’, ‘as’, ‘assert’, ‘async’, ‘await’, ‘break’, ‘class’, ‘continue’, ‘def’, ‘del’, ‘elif’, ‘else’, ‘except’, ‘finally’, ‘for’, ‘from’, ‘global’, ‘if’, ‘import’, ‘in’, ‘is’, ‘lambda’, ‘nonlocal’, ‘not’, ‘or’, ‘pass’, ‘raise’, ‘return’, ‘try’, ‘while’, ‘with’, ‘yield’]
变量名长的有驼峰式和下划线式的命名方式