Python学习第三天

3.2.X VS 3.x

1. 默认支持中文 UNICODE

2. 不向下兼容

3. 核心语法更易学

4.新特性默认只在3.x版本上有

Python交互器模式

开始》cmd》cd(change directory) c:\   切换目录 

注意:1. cd路径只能在本盘符中切换路径,如果从c盘切换到d盘,直接输入“d:”就可以切换到d盘

2. 返回上一层目录 》cd.. 返回上两层目录  》cd..\..

3. 》dir 查看当前目录下的文件列表

4. 用python执行某一个文件夹下面的txt格式的文件: txt文件所在的盘(e:\)+python.exe所在的文件夹(d:\Python37\python.exe)+空格+ txt文件所在的位置    注意:Tab键可以进行文件夹的切换

文件扩展名   后缀名

.py python文件 

.java   java文件 

.js  Java script文件 

环境变量

系统变量

变量  

1. 作用:为了存储St程序运算过程中的一些中间结果,为了方便日后调用

store information  to be referenced and manipulated in a computer program. They also provide a way of labeling data with a descriptive name. It is helpful to think of variables as containers that hold information.Their sole purpose is to lable and store data in memory. This data can then be used trought your program.

2. 命名规则:

a. 要具有描述性

b. 变量名只能以下划线、数字、字母组成,不能是空格或特殊字符

c. 不能以中文为变量名

d. 不能以数字开头

e. 保留字符不能被使用

注意:全部大写的变量名表示此变量为常量

3. 变量的赋值

4. 内存的释放  内存回收机制

posted @ 2020-07-26 19:26  千与千寻mj  阅读(122)  评论(0)    收藏  举报