Commit 3feccb0d by BellCodeEditor

save project

parent f0cc1948
Showing with 14 additions and 0 deletions
dict = {"苹果":2,"梨子":3,"香蕉":5,"甘蔗":6}
k = input("请输入水果名称:")
v = input("请输入该水果价格:")
if k in dict:
if int(v) > dict[k]:
dict[k] = int(v)
print(f"亲爱的{k}同学你好,您的分数{v}已经刷新成功!")
else:
print(f"亲爱的{k}同学你好,您的最高分数{dict[k]}已经保留!")
else:
dict[k] = int(v)
print(f"亲爱的{k}同学你好,已经为您创建新的成绩单!")
print(dict)
\ 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