Numeric types can be converted to other numeric types by using the appropriate type conversion functions. The functionÕs name is the name of the destination type.
The ord and chr functions are used to convert between integers and characters, as follows:
The str function converts any Python object to its corresponding string representation.
Numeric types can be converted to other numeric types by using the appropriate cast operators. A cast operator is formed by enclosing the destination type name in parentheses.
When casting from an integer to a character or the other way around, the integer is assumed to be the characterÕs Unicode value.
The simplest way to convert any value to a string is to concatenate it to an empty string, as follows:
"" + 3.14
"" + 45