fork download
  1. src = [0,'A',1,'A',3,'A',5,'B',8,'A',13,'A',20,'A']
  2. dst = []
  3. sep = src[src.index('B')-1]
  4. for i in range(0, len(src), 2):
  5. if src[i]>=sep:
  6. dst.append(src[i])
  7. dst.append(src[i+1])
  8. print dst
  9.  
Success #stdin #stdout 0.08s 10864KB
stdin
Standard input is empty
stdout
[5, 'B', 8, 'A', 13, 'A', 20, 'A']