参数形式
- str(object=”)
- str(object=b”, encoding=’utf-8’, errors=’strict’)
Manual
Return a str version of object. See str() for details.
str is the built-in string class. For general information about strings, see Text Sequence Type — str.
直译
返回object的str版本。
str是内建字符串类,可以从文本序列类型 — str获取更多信息。
实例
>>> str(1)
'1'
>>> str(b'Zoot!')
"b'Zoot!'"
>>> str(b'Zoot!', 'utf-8')
'Zoot!'