python2练习题——迭代出1~100以内8的倍数

代码如下:

def Beishu(x,y,z):
    if x >= 0 :
        pass
    else:exit()
    for s in range(y,z):
        if s % x == 0 and y < s < z:
            print s,

Beishu(8,1,100)

输出效果
在这里插入图片描述

发布了118 篇原创文章 · 获赞 1402 · 访问量 21万+

猜你喜欢

转载自blog.csdn.net/weixin_45728976/article/details/105403310