Commit a75aa89f by BellCodeEditor

auto save

parent fac93252
Showing with 12 additions and 1 deletions
...@@ -2,7 +2,8 @@ score={"小明":80,"小红":90} ...@@ -2,7 +2,8 @@ score={"小明":80,"小红":90}
name=input("名字:") name=input("名字:")
s=input("成绩:") s=input("成绩:")
if name in score: if name in score:
if int(s)>score[name]:
elif int(s)>score[name]:
score[name]=int(s) score[name]=int(s)
else: else:
score[name]=int(s) score[name]=int(s)
......
score={"小明":80,"小红":90}
name=input("名字:")
s=input("成绩:")
if name in score:
if int(s)>score[name]:
score[name]=int(s)
else:
score[name]=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