Commit af18d4fd by BellCodeEditor

save project

parent 978faa66
Showing with 11 additions and 3 deletions
...@@ -4,6 +4,13 @@ score3 = {'语文':95,'数学':100,'英语':93} ...@@ -4,6 +4,13 @@ score3 = {'语文':95,'数学':100,'英语':93}
# 请对字典进行遍历,将保存的分数以键值对的形式提取打印出来 # 请对字典进行遍历,将保存的分数以键值对的形式提取打印出来
y={'wk':score1,'ny':score2,'xb':score3} y={'wk':score1,'ny':score2,'xb':score3}
name=input("name:") name=input("name:")
info=y[name] if name in y:
for k,v in score.items(): info=y[name]
print(k,v) print("*"*30)
for k,v in info.items():
print(k,v)
print("*"*30)
else:
print("*"*30)
print("no that name")
print("*"*30)
\ No newline at end of file
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