Skip to content

num_str [terminology]

Terminology

Usage

  • Use for a string that represents a number.
  • It distinguishes the representation from an actual int or float.
  • Prefer it over num when the value's type is a string.
  • Prefer it over res when the numeric-string meaning matters.
num_str = "".join(parts)
return "0" if num_str[0] == "0" else num_str