总结

Python编程语言(基础篇)总结

共计 19 章

章节
内容
章节
内容
1
python开发环境搭建
11
集合
2
python语法基础
12
函数
3
字符串
13
类和对象
4
数字
14
面向对象编程
5
布尔类型
15
模块
6
分支语句
16
7
循环语句
17
文件
8
列表
18
内置函数
9
元组
19
校园信息管理系统-项目
10
字典

以下是上述章节学过的内容。

表达式(7/12)

名称
符号
幂运算
**
一元算术运算
-(负号)、+(正号)
二元算术运算
+(加法)、-(减法)、*、/、//、%
比较运算
<、>、==、<=、>=、!=、is、is not、in、not in
布尔运算
or、and、not
条件表达式
if -- else
lambda 表达式
lambda

简单语句(9/14)

语句
示例
表达式语句
print("xxxx")
赋值语句
z = 100、x,y=a,b、 a=b=c=x
pass 语句
pass
del 语句
del x,dict[key],list[index],obj.name
return 语句
return 表达式
break 语句
break
continue 语句
continue
import 语句
import xxx、from yyy import zzz、from yyy import *
global 语句
global

复合语句(6/10)

语句
示例
if 语句
if expression: pass; elif expression: pass; else: pass
while 语句
while expression: pass
for 语句
for variable in iterator: pass
match 语句
match expression: case value1: pass;case value2:pass
函数定义
def function_name(...):pass
类定义
class class_name(fathor_class1, fathor_class2):pass

标准库:内置函数(37/71)

类型
函数
基本输入输出函数
print()、input()
类的构造函数
int()、bool()、float()、complex()、str()、list()、tuple()、dict()、set()、frozenset()
容器统计函数
len()、sum()、max()、min()
布尔运算函数
any()、all()
整数生成器函数
range()
类和对象函数
id()、dir()、isinstance()、issubclass()、type()、super()
文件打开函数
open()
帮助函数
help()
数学运算函数
abs()、pow()、round()、divmod()
整数进制转换函数
bin()、oct()、hex()
字符编码函数
chr()、ord()
排序函数
sorted()

标准库:内置常量(3/6)

标准库:内置类型

名称
数字类型
int, float, complex
布尔类型
bool
序列类型
list, tuple, range
文本序列类型
str
集合类型
set, frozenset
映射类型
dict
其他内置类型
模块、类、函数、方法

标准库:内置模块

名称
模块
数学模块
math
随机模块
random