Python provides builtin functions that explicitly convert between data types. This is commonly known as casting. It is often necessary to cast values when they are used as arguments in a function call. It is generally necessary to cast values whenever a function or other process cannot implicitly convert a given variable to the appropriate datatype. For example when printing a string followed by a numeric type the numeric type must be cast to a string for string concatenation in the print() call to work.
str(variable) is used to cast numeric data types (integer and float) to strings.
my_int = 1605
str(my_int)
my_float = 11.05
str(my_float)
code.py output:
My values = 11.05.1605