Python标准库:内置函数repr(object)

来源:互联网 发布:淘宝频道退货 编辑:程序博客网 时间:2024/04/29 15:35

本函数是返回对象object的详细说明字符串。

例子:

#repr()print(repr(range(5)))print(repr(help))print(repr(0x200))print(repr([2,4,5]))

结果输出如下:

range(0, 5)

Type help() for interactive help, or help(object) for help about object.

512

[2, 4, 5]

 



蔡军生  QQ:9073204  深圳

0 0