fork(2) download
  1. yoba = [ 0, 1, 4, 6, 3, 4, 0, 0, 4, 2, 4 ]
  2. for i, x in enumerate(filter(lambda z: z > 0, yoba)):
  3. if i % 2 == 0:
  4. print('%d --1--' % x)
  5. else:
  6. print('%d --2--' % x)
Success #stdin #stdout 0.01s 28376KB
stdin
Standard input is empty
stdout
1 --1--
4 --2--
6 --1--
3 --2--
4 --1--
4 --2--
2 --1--
4 --2--