1.已知字典score中存储 了某个学生的学科和成绩信息,scoref(语文:90;英语:92;数学:98,'计算机:96},请按要求完成以下题目。
(1)将键作为索引获取字典score中语文的成绩
(2)在字典score中增加键值对思想政治':99
(3)将字典score中数学的成绩修改为95
(4)使用del关键字删除字典score中计算机的成绩
(5)使用for循环遍历字典score中所有的键值对
这样?
score={'语文':90,'英语':92,'数学':98,'计算机':96}
print(score['语文'])
score['思想政治']=99
score['数学']=95
del score['计算机'];
for item in score:
print(item+':'+str(score[item]))