Skip to content

Commit

Permalink
print average score
Browse files Browse the repository at this point in the history
  • Loading branch information
qiwsir committed Jun 3, 2014
1 parent cb8551f commit 16ce05d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions average_score.py
Expand Up @@ -20,9 +20,11 @@ def less_average(score):
sum_score = sum(score)
ave_num = sum_score/num
less_ave = [i for i in score if i<ave_num]
return len(less_ave)
return (ave_num,len(less_ave))

if __name__=="__main__":
score = make_score(40)
print "the number of less average is:",less_average(score)
average_num,less_num = less_average(score)
print 'the score of average is:',average_num
print "the number of less average is:",less_num
print "the every socre is[from big to small]:",sorted(score,reverse=True)

0 comments on commit 16ce05d

Please sign in to comment.