Commit 33619d80 by BellCodeEditor

save project

parent d9d64250
Showing with 12 additions and 0 deletions
score = {"张三":35,"李四":90,"王五":78,"赵六":59,"郑七":98}# 成绩单字典
n = input("请输入你的名字:")#输入名字
s = input("请输入你的成绩:")#输入成绩
if n in score:#如果输入的名字在字典里
if int(s) > score[n]:#如果输入的成绩大于之前的成绩
score[n]=int(s)#把输入的成绩替换原来的成绩
print(score)#打印字典
else:#否则
score[n] = int(s)#把输入的成绩存储到字典
print(score)#打印字典
\ 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