1,计算机初识
cpu 操作系统 硬盘 内存
2,变量 常量 IDE 解释器 python 种类
3,格式化:
% format f
4,内置函数
input() 输入
print() 输出
int()
str()
bool()
list()
id()
type()
5, 流程控制
if 条件
while 循环
for 循环
可迭代对象
range(数字)
6,数据类型
str
格式化
索引,切片
方法
upper(),lower(),startswith(),endswith(),replace(),strip(),center(),find(),index(),capitalize(),swapcase()
公共方法:count(),len(),index()
int
float() 浮点型
str-->int 要求str的元素必须是数字
bool
list
增 3种
append() insert() extend() li[2:2]
删 4 种
pop() 按索引删除,有返回值的
remove() 按元素删除
clear() 清空列表
del li[3] del li[3:8] del li[2:4:2]
del li
改
li[2]=8 按索引改
li[2:4]=9 按切片改
查
按索引
按切片
for
嵌套
tuple
dict
set
浙公网安备 33010602011771号