builtin_allany.py 258 B

12345678910111213141516171819
  1. # test builtin "all" and "any"
  2. tests = (
  3. (),
  4. [],
  5. [False],
  6. [True],
  7. [False, True],
  8. [True, False],
  9. [False, False],
  10. [True, True],
  11. range(10),
  12. )
  13. for test in tests:
  14. print(all(test))
  15. for test in tests:
  16. print(any(test))