摘要:
重点是什么是质数,以及怎么求质数#!/usr/bin/python# -*- coding:UTF-8 -*-'''Findprime number判断101-200之间有多少个素数,并输出所有素数。何为素数:质数(外文名prime number)又称素数,有无限个。... 阅读全文
posted @ 2017-07-18 23:23
yuerspring
阅读(199)
评论(0)
推荐(0)
摘要:
#!/usr/bin/python# -*- coding:UTF-8 -*-import time"""pause for 2 seconds and format the timestamp"""def pause(n): for x in range(1... 阅读全文
posted @ 2017-07-18 22:35
yuerspring
阅读(182)
评论(0)
推荐(0)
摘要:
两层数据嵌套#!/usr/bin/python# -*- coding:UTF-8 -*-""""print (9 9 ) --> Multiplication Table"""for x in range(1,10): print for k in r... 阅读全文
posted @ 2017-07-18 22:25
yuerspring
阅读(366)
评论(0)
推荐(0)
摘要:
地址copy ,数据copy# -*- coding;utf-8 -*-#list copy"""将一个列表的数据复制到另一个列表中。核心就是浅拷贝还是深拷贝(地址 or 数据 )"""sourcelist = [11,333,444,555,6,7,6]print ... 阅读全文
posted @ 2017-07-18 22:24
yuerspring
阅读(149)
评论(0)
推荐(0)
摘要:
#! /usr/bin/python# -*- coding:utf-8 -*-"""an interesting topic Fibonacci sequence"""#the method we know how to solve this issue ----... 阅读全文
posted @ 2017-07-18 22:19
yuerspring
阅读(137)
评论(0)
推荐(0)