from collections import defaultdict
results = [“pass”, “pass”, “fail”, “pass”, “fail”, “pass”]
stats = defaultdict(int)
for result in results:
stats[result] += 1
print(dict(stats))
from collections import defaultdict
results = [“pass”, “pass”, “fail”, “pass”, “fail”, “pass”]
stats = defaultdict(int)
for result in results:
stats[result] += 1
print(dict(stats))