Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def numslice(x, start=None, stop=None, system=10):
- if start is None:
- start = 0
- if stop is None:
- stop = int(mlog.log(system)(x)) + 1
- if start < 0 and stop >= 0:
- start = int(mlog.log(system)(x)) + 1 + start
- elif stop < 0 and start >= 0:
- stop = int(mlog.log(system)(x)) + 1 + stop
- if stop <= start:
- raise ValueError
- return nth(x, stop - 1, abs(start - stop), system)
Add Comment
Please, Sign In to add comment