Advertisement
here2share

# b_seqCombos.py

Jul 8th, 2018
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.19 KB | None | 0 0
  1. # b_seqCombos.py
  2. def seqco(s,r=3):
  3.     t = []
  4.     while len(s) > r-1:
  5.         sss = s[:]
  6.         while len(sss) > r-1:
  7.             t.append(sss[:r])
  8.             sss.pop(r-1)
  9.         s = s[1:]  
  10.     return t
  11.  
  12. print seqco([0,1,2,3,4])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement