fork download
  1. f=lambda l:l and l==zip(*zip(*l))
  2.  
  3. tests = [
  4. [],
  5. [(1,), (1,), (2,)],
  6. [(1,)],
  7. [(1, 2, 3, 4)],
  8. [(1, 2, 3, 4, 5), (2,), (12, 314123)],
  9. [(1, 2, 3, 4), (1,)]
  10. ]
  11.  
  12. for test in tests:
  13. print(f(test))
Success #stdin #stdout 0.01s 8968KB
stdin
Standard input is empty
stdout
[]
True
True
True
False
False