fork(1) download
  1. lst = [
  2. [0, 0, 0, '', 0, 0, 0, 0, 0],
  3. [0, 0, 0, 0, 'b', 0, 0, 0, 0],
  4. [0, 0, 0, 0, 0, 0, 'c', 0, 0],
  5. [0, 0, 0, 0, 0, 0, 0, '', 0],
  6. [0, 0, 0, 0, 0, 0, 0, 0, '']
  7. ]
  8. print([next((i for i in s if i != 0), 0) for s in zip(*lst)])
Success #stdin #stdout 0.04s 9592KB
stdin
Standard input is empty
stdout
[0, 0, 0, '', 'b', 0, 'c', '', '']