Home >>Python Built-in Functions >Python str() Function
Python str() function is used to convert the given input value into a string.
Syntax:str(object, encoding=encoding, errors=errors)
Parameter | Description |
---|---|
object | This parameter defines the object to convert into a string. |
Encoding | This parameter defines the encoding of the object. |
Errors | This parameter defines what to do if the decoding fails. |
x = str(9.5)
print(x)
x = int("32")
print(x)