[Tutor] Creatively solving math problems -----help

Clay Shirky clay at shirky.com
Thu Sep 11 10:52:42 EDT 2003


> for x in range(20000):
>       if [x%y for y in range(2, 7)] == 1 and x % 7 == 0:
>               print x

This is awfully hard to read -- any reason you're trying to cram so much
stuff on one line? Is this what you are trying to do?

for x in range(20000):
    for y in range(2, 7):
        if x % y == 1 and x % 7 == 0:
            print x
            break

If so, it will be easy to start altering from there.

-clay




More information about the Tutor mailing list