from lib_misc import permutations from lib_prime import is_prime def euler_041(): for pandigital in permutations("7654321"): p = int("".join(pandigital)) if is_prime(p): return p if __name__ == "__main__": print("e041.py: " + str(euler_041())) assert(euler_041() == 7652413)