摘要:
在学Python,在看《Python核心编程》的pdf,做了Chap2的题目,答案为DIY# Filename: 2-11.py# Author: ChrisZZmylist = [1, 2, 3, 4, 6]sum = 0for i in mylist: sum = sum + iaverage = sum * 1.0 / len(mylist)while True: print 'Here we have a list:', mylist option = raw_input('Whatyou gonna know(sum/average/exit)?') 阅读全文