随笔分类 -  python

摘要:import copylist1=[1,2,3,4,5]c_list1=list1c_list1[0]=-1for i in list1: print str(i)+' ',#输出的世 -1,2,3,4,5print '\n'print "+++++++++++++++++"list2=[1,... 阅读全文
posted @ 2015-08-23 22:31 ivyxjc 阅读(147) 评论(0) 推荐(0)
摘要:As an example of subclassing, the random module provides the WichmannHill class that implements an alternative generator in pure Python. The class pro... 阅读全文
posted @ 2014-11-05 23:12 ivyxjc 阅读(318) 评论(0) 推荐(0)
摘要:第12题:拥有超过500个因数的第一个三角数(1+2+3+4+......)def findivisionnum(num): count = 0 n=1 import math while count<num: count = 0 for i in... 阅读全文
posted @ 2014-09-27 17:58 ivyxjc 阅读(200) 评论(0) 推荐(0)
摘要:欧拉计划(Project Euler)是一个解题网站,站内提供了一系列数学题供用户解答。以下代码均为本人亲自编写,仅保证答案与欧拉项目的答案相同。至于代码质量,能力有限,只能尽力而为。第一题:a=0for i in range(1,1000): if i%3==0 or i%5==0: ... 阅读全文
posted @ 2014-09-13 22:00 ivyxjc 阅读(1188) 评论(0) 推荐(0)