Python repr() 函数

Python 教程 · 2019-02-01 16:58:45

描述

repr() 函数将对象转化为供解释器读取的形式。

语法

以下是 repr() 方法的语法:

repr(object)

参数

  • object -- 对象。

返回值

返回一个对象的 string 格式。

实例

以下展示了使用 repr() 方法的实例:

>>>s = 'CODERCTO' >>> repr(s) "'CODERCTO'" >>> dict = {'codercto': 'codercto.com', 'google': 'google.com'}; >>> repr(dict) "{'google': 'google.com', 'codercto': 'codercto.com'}" >>>

点击查看所有 Python 教程 文章: https://codercto.com/courses/l/8.html

查看所有标签

Wikis For Dummies

Wikis For Dummies

Dan Woods、Peter Thoeny / For Dummies / 2007-7-23 / USD 24.99

Corporations have finally realized the value of collaboration tools for knowledge sharing and Wiki is the open source technology for creating collaborative Web sites, as either a public site on the In......一起来看看 《Wikis For Dummies》 这本书的介绍吧!

随机密码生成器
随机密码生成器

多种字符组合密码

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具