目录

描述

语法

参数

返回值

实例


描述

将对象转化为供解释器读取的形式

语法

repr(object)

参数

  • object -- 对象

返回值

返回一个对象的 string 格式

实例

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


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

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

Logo

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

更多推荐