目录

描述

语法

参数

返回值

实例


描述

将对象转化为适于人阅读的形式

语法

class str(object='')

参数

  • object -- 对象

返回值

对象的string格式

实例

s = 'RUNOOB'
print(str(s))
dict = {'runoob': 'runoob.com', 'google': 'google.com'};
print(str(dict))


内容借鉴于菜鸟教程,感谢

Python str() 函数 | 菜鸟教程https://www.runoob.com/python/python-func-str.html

Logo

Agent 垂直技术社区,欢迎活跃、内容共建。

更多推荐