Python str() Function
Definition and Usage
The str()
function converts the specified
value into a string.
Syntax
str(object, encoding=encoding, errors=errors)
Parameter Values
Parameter | Description |
---|---|
object | Any object. Specifies the object to convert into a string |
encoding | The encoding of the object. Default is UTF-8 |
errors | Specifies what to do if the decoding fails |
More Examples
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.