一丶环境搭建
1.anaconda环境配置
参考https://blog.csdn.net/ITLearnHall/article/details/81708148
2.解释器
运行Python代码需要通过Python解释器去执行文件;
Python的解释器有很多,如CPython,Jython等等,运行在不同的平台上对应着不同的解释器。
二丶python初体验
print and input
三丶python基础讲解
1.python变量特性+命名规则
在python中,定义变量的时候,不需要指定变量的类型;
在Python中,等号=是赋值语句,可以把任意数据类型赋值给变量,同一个变量可以反复赋值,而且可以是不同类型的变量,如
它不像C语言中在定义变量时就定下了变量的类型,而是一种动态的语言
命名规则:变量名必须是大小写英文、数字和_的组合,且不能用数字开头
2.注释方法
1)单行注释

#(注释内容)
2)多行注释

用三个单引号或双引号进行多行注释
3.python中“:”作用
函数,循环,if条件,类定义等后面有block,block要缩进,因此这些语句后面要加上冒号。
4.学会使用dir( )及和help( )
dir()用来查询一个类或者对象所有属性
help()函数帮助我们了解模块、类型、对象、方法、属性的详细信息;帮助查看方法的详细使用信息(使用时要注意输入完整路径,使用模块帮助时,需要先导入模块)。
5.import使用
# 导入一个模块
import model_name
# 导入多个模块
import module_name1,module_name2
# 导入模块中的指定的属性、方法(不加括号)、类
from moudule_name import moudule_element [as new_name]
6.pep8介绍
pep8是python中的书写规范,具体介绍如下:

四丶python数值基本知识
1.python中数值类型,int,float,bool,e记法等
int,整型
float,浮点型
bool,布尔型(true,false)
e记法,科学计数法
2.算数运算符


3.逻辑运算符

4.成员运算符

5.身份运算符

6.运算符优先级

网友评论