1.1 Python 简介与版本选择
1.2 安装 Python(Windows / macOS / Linux)
1.3 配置开发环境(IDLE、VS Code、PyCharm 简介)
1.4 编写并运行第一个程序:print("Hello, World!")
print("Hello, World!")
1.5 使用命令行与交互式解释器(REPL)
2.1 注释与代码风格(PEP 8 简介)
2.2 变量与命名规则
2.3 基本数据类型:
整数(int)
int
浮点数(float)
float
布尔值(bool)
bool
字符串(str)
str
复数(complex)
complex
2.4 类型检查与转换(type(), int(), str() 等)
type()
int()
str()
2.5 动态类型与变量赋值机制
3.1 算术运算符(+, -, *, /, //, %, **)
+
-
*
/
//
%
**
3.2 比较运算符(==, !=, <, >, <=, >=)
==
!=
<
>
<=
>=
3.3 逻辑运算符(and, or, not)
and
or
not
3.4 赋值运算符(= 与复合赋值如 +=)
=
+=
3.5 运算符优先级与括号使用
4.1 条件语句:if / elif / else
if
elif
else
4.2 循环语句:
while 循环
while
for 循环(遍历序列)
for
4.3 循环控制:break 与 continue
break
continue
4.4 range() 函数的使用
range()
4.5 综合示例:猜数字游戏
5.1 列表(list):创建、索引、切片、方法(append, remove, sort 等)
list
append
remove
sort
5.2 元组(tuple):不可变序列,用途与解包
tuple
5.3 字典(dict):键值对操作,常用方法(get, keys, values)
dict
get
keys
values
5.4 集合(set):去重、集合运算(union, intersection)
set
union
intersection
5.5 容器嵌套与选择建议
6.1 字符串格式化:
f-string(推荐)
.format()
% 格式化(了解即可)
6.2 常用字符串方法(split, join, strip, replace, find)
split
join
strip
replace
find
6.3 多行字符串与转义字符
6.4 编码基础:UTF-8 与 encode()/decode()
encode()
decode()
7.1 定义与调用函数(def)
def
7.2 参数传递:位置参数、关键字参数
7.3 返回值(return)与无返回值函数
return
7.4 默认参数与可变参数(*args, **kwargs 简介)
*args
**kwargs
7.5 作用域与局部/全局变量(global 关键字)
global
7.6 文档字符串(docstring)与函数注解(简介)
8.1 导入模块:import 与 from ... import ...
import
from ... import ...
8.2 标准库常用模块简介(math, random, datetime, os)
math
random
datetime
os
8.3 创建自定义模块
8.4 包(package)结构与 __init__.py
__init__.py
8.5 安装第三方库(pip 基础)
pip
9.1 打开与关闭文件(open(), with 语句)
open()
with
9.2 读取文件:read(), readline(), readlines()
read()
readline()
readlines()
9.3 写入文件:write(), writelines()
write()
writelines()
9.4 文件路径处理(os.path 与 pathlib 简介)
os.path
pathlib
9.5 异常安全的文件操作
10.1 什么是异常?常见内置异常类型
10.2 try / except 基本结构
try
except
10.3 捕获特定异常与多异常处理
10.4 else 与 finally 子句
finally
10.5 主动抛出异常(raise)
raise
11.1 类与对象的概念
11.2 定义类与创建实例
11.3 实例属性与方法(self 的作用)
self
11.4 构造方法 __init__
__init__
11.5 封装简介(公有 vs 私有约定)
12.1 项目:简易通讯录管理系统
12.2 功能要求:
添加、查询、删除联系人
数据持久化到文件
用户交互菜单
12.3 代码组织与调试技巧