Skip to content

res [terminology]

Terminology

Usage

  • Use for a return collection or constructed output.
  • Typical types include:
    • Lists
    • Nested lists
    • Sets
    • Mappings
    • Constructed strings
  • It is most suitable when the function is short and the output's meaning is obvious from the function.
  • Prefer a semantic name such as colors or dist when it conveys important structure.
res = []

for x in nums2:
    if counts[x] > 0:
        res.append(x)

return res