如果使用功能,如何跳过行?

时间:2019-10-19 21:03:25

标签: python

如果使用了replace()函数,如何跳过行?

num = int(input());
i = 1111;
while i < 9999:
    i = str(i);
    i = i.replace("0","1");
    if(num % int(i[3]) == 0
       and num % int(i[2]) == 0
       and num % int(i[1]) == 0
       and num % int(i[0]) == 0):
        print(i, end=" ");
    i = int(i);
    i += 1;  # **Skip this line if "0" is replaced**

0 个答案:

没有答案