How do I convert an integer to a string?
42 ⟶ "42"
For the reverse, see How do I parse a string to a float or int?. Floats can be handled similarly, but handling the decimal points can be tricky because floating-point values are not precise. See Converting a float to a string without rounding it for more specific advice.
Links to the documentation:
int()str()str(x)converts any objectxto a string by callingx.__str__(), orrepr(x)ifxdoesn’t have a__str__()method.