python计算阶梯数的问题

x = 7
i = 1
flag = 0

while i <=100:
if (x%2 == 1) and (x%3 == 2) and (x%5 == 4) and (x%6 == 5):
flag = 1
else:
x = 7*(i+1)
i += 1

if flag == 1:
print("你的阶乘是:",x)
else:
print("在您指定的范围内找不到答案!")

    以上是计算阶梯数的代码。请问在大位侠们,为何运行不了。。。

不知道你说的阶梯数是什么意思,而且你的代码缩进也不对。

 # coding=utf-8
x = 7
i = 1
flag = 0
while i <=100:
    if (x%2 == 1) and (x%3 == 2) and (x%5 == 4) and (x%6 == 5):
        flag = 1
    else:
        x = 7*(i+1)
    i += 1
if flag == 1:
    print "你的阶乘是:%d"%(x)
else:
    print("在您指定的范围内找不到答案!")