Python菜鸟晋级03----repr() 与str() 函数的区别
来源:互联网 发布:行知高中 编辑:程序博客网 时间:2024/04/29 16:32
两者均是将数值转换成字符串的形式,但是有细微的区别
str()会创建一个适合人阅读的字符串。
repr()会创建适合解释器阅读的字符串。
>>> hello = 'hello, world\n'>>> hellos = repr(hello)>>> hellos"'hello, world\\n'" #出现反斜杠进行转意>>> hellos=str(hello)>>> hellos'hello, world\n'
上一讲:Python菜鸟晋级02----Python3的bytes与str
下一讲:Python菜鸟晋级04----raw_input() 与 input()的区别
欢迎收听我的微信公众号
0 0
- Python菜鸟晋级03----repr() 与str() 函数的区别
- python 中 str() 与 repr() 的区别
- python中str()与repr()的区别
- python str与repr的区别
- Python str() 与 repr() 的区别
- str()与repr()的区别
- str与repr的区别
- Python菜鸟晋级02----Python3的bytes与str
- [python]python中str()与repr()的区别与联系
- Python里str函数和repr函数的区别
- Python里str函数和repr函数的区别
- python 内建函数 str() 和 repr() 的区别
- python 内建函数 str() 和 repr() 的区别
- python核心编程:repr()与str()的区别
- Python的内建函数str()与repr()
- python学习 str与repr区别
- Python repr str 函数
- 区别python 的str和repr
- msf连接数据库
- 基于OpenCV的细胞图像识别
- 关于ios中简单单例的创建
- Windows下配置Git
- objective-c中nonatomic,assign,copy,retain的区别
- Python菜鸟晋级03----repr() 与str() 函数的区别
- 数据结构习题订正MARK
- top
- Merge Sorted Array
- Putty配色字体设置教程
- SQList
- ServletConfig ServletContext ApplicatoinContext 区别与联系
- cocos2d-x 3.2 rc0 编译错误解决
- 小四轴之第二次飞行篇