Commit f6e55da2 by BellCodeEditor

save project

parent dbc39880
Showing with 26 additions and 4 deletions
score = {'语文':91,'数学':88,'英语':85}
for k,v in score.items():
print(k,v)
# 请对字典进行遍历,将保存的分数以键值对的形式提取打印出来
# key : value
#增 删 改 查
score['语文'] = 88 #改
score['道德'] = 20 #增
print(score)
#查
if "语文" in score:
print("有")
else:
print('无')
\ No newline at end of file
s1 = {'语':80,'数':90,'外':85}
s2 = {'语':84,'数':88,'外':77}
s3 = {'语':100,'数':100,'外':100}
classroom = {"张三":s1,"李四":s2,"王五":s3}
while True:
name = input("请问你找谁?")
if name in classroom:
a = classroom[name]
for k,v in a.items():
print(k,v)
else:
print("你确定是此人吗?")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment