1.列表实例：由字符串创建一个作业评分列表，做增删改查询统计遍历操作。例如，查询第一个3分的下标，统计1分的同学有多少个，3分的同学有多少个等。

s = {'01':'100','02':'99','03':'98','04':'97','05':'96','05':'96','06':'95','07':'98','08':'90','09':'91'}
print('成绩表：',s)
s.pop('09')
print('成绩表：',s)
print('主键是：',s.keys())
print('分数是：',s.values())
x = input('输入学号查分数：')
print(s.get(x,"没有这个人的分数"))

2.字典实例：建立学生学号成绩字典，做增删改查遍历操作。

zd={"王维":"90","柳丁":"98","许发":"77","张嗯嗯":"88"}
print(zd)
zd['王维']='59' print(zd)

3.列表，元组，字典，集合的遍历。总结列表，元组，字典，集合的联系与区别。
lb=list('1223334444455555666666')
yz=tuple('1223334444455555666666')
jh=set('1223334444455555666666')
zd={"jyb":"b6014","zzx":"b5008","hzt":"b6016"}
print('列表遍历：')
print(lb)
for i in lb:
print(i,end=' ')
print('\n')
print('元组遍历：')
for i in yz:
print(i,end=' ')
print('\n')
print('集合遍历：')
for i in jh:
print(i,end=' ')
print('\n')
print('字典遍历：')
for i in zd:
print(i,end=' ')

4.英文词频统计实例

1. 待分析字符串
2. 分解提取单词
1. 大小写 txt.lower()
2. 分隔符'.,:;?!-_’
3. 计数字典
4. 排序list.sort()
5. 输出TOP(10)

panama='''Daca nici asa nu-ti place
Ia mai zboara-n Panama
Zile zile zile zile eu alerg girl
Mile mile mile mile pe maidan
Pentru tine tine sa-ti dau un dar dar
Cel mai de pret dar fara nici un ban ban
Ganja iarba sunt inutile-tile
Numai tu stii sa-mi dai aripile-pile
In Jamaica sau in Chile Chile
Inima face Boom-Boom numai pentru tine
Eh eh eh eh eh eh eh eh eh eh
Numai pentru tine
Eh eh eh eh eh eh eh eh eh eh
N-ai raspuns la telefon
No problem te scot pe balcon
Si-o sa vezi cu ochii tai
Cum ti-aduc flori un camion
Si iti cant asa cu chitara mea
Daca nici asa nu-ti place
Ia mai zboara-n Panama
Ce pana mea
Ah ah ah ah mai zboara-n Panama
Ah ah ah ah zboara ce pana mea
Ah ah ah ah mai zboara-n Panama
Ah ah ah ah hai mai zboara
Kile-kile kile-kile eu am dat jos
Oricum baby nu erau de folos-los
Mi-e dor de tine sunt intors pe dos-dos
Acasa ajung la timp tre&apos; sa o iau pe jos-jos
La ce ne folosesc banii banii banii
Daca tu imi dai iubire si zi de zi pun anii
Ca Bonnie Clyde sa fiu doar eu cu tine
Si o sa avem girl o iubire ca in filme
Eh eh eh eh eh eh eh eh eh eh
O iubire ca in filme
Eh eh eh eh eh eh eh eh eh eh Eh
N-ai raspuns la telefon
No problem te scot pe balcon
Si-o sa vezi cu ochii tai
Cum ti-aduc flori un camion
Si iti cant asa cu chitara mea
Daca nici asa nu-ti place
Ia mai zboara-n Panama Ce pana mea
Ah ah ah ah mai zboara-n Panama
Ah ah ah ah zboara ce pana mea
Ah ah ah ah mai zboara-n Panama
Ah ah ah ah Eh Oh no
Baby girl hai vino incoa&apos;
Am dragoste la mine o dau la schimb cu a ta
Baby girl dragostea mea
E de calitate dau gramul gram hai ia
N-ai raspuns la telefon
No problem te scot pe balcon
Si-o sa vezi cu ochii tai
Cum ti-aduc flori un camion
Si iti cant asa cu chitara mea
Daca nici asa nu-ti place
Ia mai zboara-n Panama Ce pana mea
Ah ah ah ah mai zboara-n Panama
Ah ah ah ah zboara ce pana mea
Ah ah ah ah mai zboara-n Panama
Ah ah ah ah hai ma zboara Pwaah'''
panama=panama.replace('?',' ')
panama=panama.replace('!',' ')
panama=panama.replace(',',' ')
panama=panama.replace('.',' ')
panama=panama.replace('-',' ')
panama=panama.replace('&',' ')
panama=panama.lower()

words=panama.split(' ')
zd={}
key=set(words)
for i in key:
zd[i]=words.count(i)
lb=list(zd.items())
lb.sort(key=lambda x:x[1],reverse=True)
print('频率最高top10：\n')
for i in range(10):
print(lb[i])

6.