Python str() Function
Description
The str() function converts an object into a human-readable form.
Syntax
The following is the syntax of the str() method:
class str(object='')
Parameters
- object -- the object.
Return Value
Returns the string form of an object.
Example
The following examples demonstrate the use of the str() method:
s
=
'
RUNOOB
'
str
(
s
)
'
RUNOOB
'
dict
= {
'
runoob
'
:
'
runoob.com
'
,
'
'
:
'
google.com
'
}; >>>
str
(
dict
)
"
{'google': 'google.com', 'runoob': 'runoob.com'}
"
Python built-in function