Skip to content

count / counts [terminology]

Terminology

Usage

  • Use counts for a mapping or collection of per-item counts.
  • Use cnt for one scalar count.
  • Keeping the plural form for the mapping prevents confusion between a frequency table and one frequency.
counts = Counter(nums)

for x in nums2:
    if counts[x] > 0:
        counts[x] -= 1