Commit a6aab7be by BellCodeEditor

auto save

parent 6625a543
Showing with 10 additions and 8 deletions
scores={"语文":98,"数学":85,"英语":90} scores={"语文":98,"数学":85,"英语":90}
v=0 score=0
for v in scores.values(): s_pingjunfen=0
v+=v for k,v in scores.items():
print(v) score+=v
\ No newline at end of file print(score)
s_pingjunfen=score/3
print(s_pingjunfen)
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
scores = {'语文':89, '数学':95, '英语':80} scores = {'语文':89, '数学':95, '英语':80}
score = 0 score = 0
def get_average(abc): def get_average(scores):
for subject, score in abc.items(): for subject, score in scores.items():
print('现在的总分是%d'%score) print('现在的总分是%d'%score)
score += score[] score += score
print(subject,score) print(subject,score)
ave_score = score/len(scores) ave_score = score/len(scores)
print('平均分是%d'%ave_score) print('平均分是%d'%ave_score)
......
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