Python

1.解释器路径

  #!/usr/bin/env python

2.编码

  # -*- coding:utf8 -*-

  1.ascill  ---00000000  (8个位表示)

    缺点:表示不了英文

  2.unicode  ---0000000000000000+  (至少16位表示)

    缺点:消耗内存,当表示位不需要16位以上,造成多余内存消耗

  1.   3.utf-8  ---能用多少表示就是用多少表示

  Python3 无需关注

  Python2 每个文件中只要出现中文,头部必须加

3.变量名  

- 字母
- 数字
- 下划线

三元素组成变量

  • 不能以字母开头
  • 不能是关键字('and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'exec', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'not', 'or', 'pass', 'print', 'raise', 'return', 'try', 'while', 'with', 'yield')
  • 最好不要和python内置的函数名重复

4.推荐编程软件

  Pycharm

原文地址:https://www.cnblogs.com/lee-xingxing/p/8052998.html