Advertisement
Guest User

Untitled

a guest
Aug 4th, 2015
485
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1.  
  2. for s in itertools.product('0123456789', ('+', '-', '*', '/', '**'), '0123456789', ('+', '-', '*', '/', '**')):
  3. try:
  4. e = '2' + ''.join(s) + '5'
  5. if eval(e) == 2015:
  6. print(s)
  7. except Exception:
  8. pass
  9. for s in itertools.product(('+', '-', '*', '/', '**'), '0123456789', ('+', '-', '*', '/', '**'), '0123456789'):
  10. try:
  11. e = '2' + ''.join(s) + '5.0'
  12. if abs(eval(e) - 2015) < 0.01:
  13. print(e)
  14. except Exception:
  15. pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement