fork download
  1. s = (
  2. "abcde",
  3. "bcdef",
  4. "cdefg",
  5. )
  6.  
  7. for head, *_, tail in s:
  8.  
  9. print(head, _, tail)
  10.  
Success #stdin #stdout 0.02s 9984KB
stdin
Standard input is empty
stdout
a ['b', 'c', 'd'] e
b ['c', 'd', 'e'] f
c ['d', 'e', 'f'] g