Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for s in itertools.product('0123456789', ('+', '-', '*', '/', '**'), '0123456789', ('+', '-', '*', '/', '**')):
- try:
- e = '2' + ''.join(s) + '5'
- if eval(e) == 2015:
- print(s)
- except Exception:
- pass
- for s in itertools.product(('+', '-', '*', '/', '**'), '0123456789', ('+', '-', '*', '/', '**'), '0123456789'):
- try:
- e = '2' + ''.join(s) + '5.0'
- if abs(eval(e) - 2015) < 0.01:
- print(e)
- except Exception:
- pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement