首页 > 编程语言 > 详细

Python 练习 21

时间:2016-05-26 17:14:14      阅读:215      评论:0      收藏:0      [点我收藏+]
#!/usr/bin/python
# -*- coding: UTF-8 -*-

h = 0
leap = 1
from math import sqrt
from sys import stdout
for m in range(101,201):
    k = int(sqrt(m + 1))
    for i in range(2,k + 1):
        if m % i == 0:
            leap = 0
            break
    if leap == 1:
        print %-4d % m
        h += 1
        if h % 10 == 0:
            print ‘‘
    leap = 1
print The total is %d % h

 

Python 练习 21

原文:http://www.cnblogs.com/kuihua/p/5531807.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!