fork download
  1. A = [[1, 0, 0],
  2. [1, 1, 1],
  3. [0, 1, 0]]
  4.  
  5. B = [['a', 'c', 's'],
  6. ['y', 'e', 's'],
  7. ['u', 'w', 'g']]
  8.  
  9. C = [['i', 'p', 'u'],
  10. ['k', 'l', 'n'],
  11. ['h', 'o', 'm']]
  12.  
  13. print([[a and b or c for a, b, c in zip(*t)] for t in zip(A, B, C)])
Success #stdin #stdout 0.03s 9576KB
stdin
Standard input is empty
stdout
[['a', 'p', 'u'], ['y', 'e', 's'], ['h', 'w', 'm']]