Skip to content

a / b [terminology]

Terminology

Usage

  • Use for two symmetric arithmetic operands or two objects with equivalent roles.
  • They work well when the original parameter names are long and their roles become obvious from the operation.
  • Keep semantic names when the operands have distinct meanings throughout the function.
a, b = numerator, denominator
# ...
int_part, rem = divmod(a, b)

See 166. Fraction to Recurring Decimal.