tools.py 112 B

12345678
  1. def count(testFn, items):
  2. s = 0
  3. for x in items:
  4. if testFn(x):
  5. s += 1
  6. return s