Commit eb2c4870 by BellCodeEditor

save project

parent 59d41060
Showing with 6 additions and 5 deletions
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
s = {'语文':89, '数学':95, '英语':80} s = {'语文':89, '数学':95, '英语':80}
def get_average(s): def get_average(s):
s = 0 sc = 0
for subject,s in s.items(): for subject,scd in s.items():
s += s sc += scd
print('现在的总分是%d'%s) print('现在的总分是%d'%sc)
ave_s = s/len(s) ave_s = s/len(s)
print('平均分是%d'+str(ave_s)) print('平均分是%d'+str(ave_sc))
get_average(s) get_average(s)
\ 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