Commit 4540b70b authored by Taddeus Kroes's avatar Taddeus Kroes

41: Moved executed code to 'main' section.

parent f0dab743
from itertools import permutations
def is_prime(n):
if n == 2:
return True
......@@ -13,13 +11,16 @@ def is_prime(n):
return True
m = 0
if __name__ == '__main__':
from itertools import permutations
m = 0
for i in xrange(2, 10):
for i in xrange(2, 10):
for digits in permutations(map(str, range(i, 0, -1))):
n = int(''.join(digits))
if n > m and is_prime(n):
m = n
print m
print m
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment