Advertisement
here2share

# minreps.py

Mar 19th, 2020
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. # minreps.py
  2.  
  3. import math
  4. from itertools import permutations
  5.  
  6. xy = 800*800
  7. elements = 5
  8. pmax = 0
  9. ddd = {}
  10. b = (8*8)/2
  11. while elements <= b:
  12.     okay = 0
  13.     for z in range(3, elements):
  14.         p = elements**z
  15.         if p < xy:
  16.             if p > pmax:
  17.                 pmax = p
  18.                 ddd[pmax] = (elements, z)
  19.             print('{}:{} = {} combinations'.format(elements, z, p))
  20.             print(pmax)
  21.            
  22.     elements += 1
  23. 0
  24. elements, z = ddd[pmax]
  25. print('\n\n{}:{} = {} combinations'.format(elements, z, pmax))
  26. print(b)
  27.  
  28. perm = list(permutations(['a','b','c','d','e'], 3))
  29. for p in perm:
  30.     print(p)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement