Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from itertools import permutations
- # the leading number of the sum p3 is 1 - 1 is not used in the permutations
- for p in permutations([0,2,3,4,5,6,7,8,9]):
- p = reduce(lambda a, b: 10 * a + b, p)
- p , p3 = divmod(p, 1000)
- p1, p2 = divmod(p, 1000)
- if p1 < p2 and p1 + p2 == p3 + 1000:
- print p1, p2, p3 + 1000
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement