索引切片
切片的语法:【起始:结束:步长】
字符串常见操作
1.find

2.、index

3.count

4.replace

5.split

6.capitalize

7.title

8.startswith

9.endswith

10.lower

11.upper

12.ljust

13.rjust

14.center

15.lstrip

16.rstrip

17.strip

18.partition

19.rpartition

21.isalpha

22.isdigit

23.isalnum

24.isspace

25.join

列表

元组

字典

列表的方法
append添加
extend添加
insert插入
pop删除 两种 按位置
remove按名字删除
del 删除 按位置
sort 升序
sort(rever=True)降序
xxx.rever 倒序
遍历
循环遍历
for i in list:
print(" %s"%i)
统计
长度+len()
count()统计个数
print(max(xxx))
max()最大值
min()最小值
sum()求和
元组
tuple
根据值查索引xxx.index()
统计列表元素的个数xxx.count()
字典
添加
d[xxx] = xxxx
删除
xxx.pop
改[ ]=
查
print(d[xxxx])
网友评论