Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a = [1, 2, 3, 4, 5, 6, 7, 8, 9]
- limit = 3
- start = 0
- end = limit
- result = []
- for steps in a:
- if a[start:end]:
- result.append(a[start:end])
- start = end
- end += limit
- print(result)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement