Skip to content

int_part [terminology]

Terminology

Usage

  • Use for the integer portion of a fraction or decimal representation.
  • It is clearer than val when paired with a remainder or fractional part.
  • Do not use num, because the variable represents only one part of the number.
int_part, rem = divmod(a, b)
parts.append(str(int_part))