Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import itertools
- # Complete this grid with the digits (1, 2, 3, 4, 5, 6)
- # to make the sum correct:
- #
- # [ ] + [ ] - [ ] * [ ] / [ ] * [ ] = 50
- #
- def calculate(a, b, c, d, e, f):
- #return a + b - c * d / e * f
- return (((((a + b) - c) * d) / e) * f)
- i = itertools.permutations('123456')
- for p in i:
- t = tuple(int(x) for x in p)
- print t
- print calculate(*t)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement