Python str() Function
Definition and Usage
The str() function converts the specified value to a string.
Syntax
str(object, encoding=encoding, errors=errors)
Parameter Value
Parameter | Description |
---|---|
object | Any object. Specify the object to be converted to a string. |
encoding | The encoding of the object. The default is UTF-8. |
errors | Specify what to do when decoding fails. |