Guest User

Untitled

a guest
Jun 18th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. def numslice(x, start=None, stop=None, system=10):
  2. if start is None:
  3. start = 0
  4. if stop is None:
  5. stop = int(mlog.log(system)(x)) + 1
  6.  
  7. if start < 0 and stop >= 0:
  8. start = int(mlog.log(system)(x)) + 1 + start
  9. elif stop < 0 and start >= 0:
  10. stop = int(mlog.log(system)(x)) + 1 + stop
  11.  
  12. if stop <= start:
  13. raise ValueError
  14.  
  15. return nth(x, stop - 1, abs(start - stop), system)
Add Comment
Please, Sign In to add comment