Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

错别字:102.md。如果输入一个比较打的数-> 比较大 #7

Open
angli19 opened this issue Apr 20, 2015 · 4 comments
Open

错别字:102.md。如果输入一个比较打的数-> 比较大 #7

angli19 opened this issue Apr 20, 2015 · 4 comments

Comments

@angli19
Copy link

angli19 commented Apr 20, 2015

102.md中,在《数》这一小节中,第四行:
如果输入一个比较打的数.
应该是比较大

@qiwsir
Copy link
Owner

qiwsir commented Apr 20, 2015

ok. Thank you very much. I have corrected it.

@loveofmaria
Copy link

from future import division

def stat(ls):
new_ls = sorted(ls.items(),key=lambda d:d[1],reverse=True) #所有成绩从高到低排列
cj_list = tuple([x for x in ls.values()])
ave = sum(cj_list)/len(cj_list) #平均成绩
cj_max = max(tuple(cj_list)) #最高成绩分数值
cj_min = min(tuple(cj_list)) #最低成绩分数值
print("本次成绩从高到低排列如下:")
for x,y in new_ls:
print ("%s:%d" % (x,y))
print ("---------------------------------------------------------------------------------------")
low_list = {i:ls[i] for i in ls.keys() if ls[i] == cj_min} #所有成绩为最低的
high_list = {i:ls[i] for i in ls.keys() if ls[i] == cj_max}#所有成绩为最高的
print ("最低成绩的人是:")
print (low_list)
print ("---------------------------------------------------------------------------------------")
print ("最高成绩的人是:")
print (high_list)
print ("---------------------------------------------------------------------------------------")
print ("平均成绩为:%d" % ave)

if name == "main":
scores ={'zhangmazi':49,'wanger':99,'longfei':99,'gaoma':40,'huanglong':40,'chenrong':65,'zhanggang':77,'liujia':89,'tianzhigang':91,
'ganwenzi':99,'zhanglian':67,'zhouchun':40,'luoxiaoxiao':59}
stat(scores)

@loveofmaria
Copy link

我总觉得自己的思路有问题
每次总把所有要实现的功能写到一起,不会'分治'

@qiwsir
Copy link
Owner

qiwsir commented May 4, 2015

you can send your code to me, or to QQ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants