Commit a5b169f7 by BellCodeEditor

save project

parent 433aef0f
Showing with 8 additions and 9 deletions
dict_shit= {'小明':100,'小红':42}
name=input('请输入姓名:')
s=input('请输入成绩:')
if name in dict_shit:
if int(s)>dict_shit[name]:
dict_shit[name]=int(s)
print(dict_shit)
else:
print(dict_shit)
else:
if name in dict_shit and int(s)>dict_shit[name]:
dict_shit[name]=int(s)
print(dict_shit)
elif not name in dict_shit:
dict_shit[name]=int(s)
print(dict_shit)
\ No newline at end of file
print(dict_shit)
else:
print(dict_shit)
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