Python学习笔记-str和repr
来源:互联网 发布:mac 音视频处理软件 编辑:程序博客网 时间:2024/05/19 12:26
str可以将值转化为合理的字符串形式,以便用户可以理解;
repr会以合法python表达式的形式来表达值。
举例如下:
# str输出用户通常习惯的格式,repr输出系统存储格式>>> print str("Hello World")Hello World>>> print repr("Hello World")'Hello World'>>> print str(10000L)10000>>> print repr(10000L)10000L>>>
注意到,str表示一种类型,即字符串;repr则是一个函数。
0 0
- Python学习笔记-str和repr
- python-str()和 repr()
- 学习Python:repr和str的区分
- Python的str()和repr()
- python中的repr和str
- python中的str()和repr()
- python学习 str与repr区别
- 区别python 的str和repr
- python之repr()和str()的区别
- python中str()和repr()区别
- Python 的repr() 和str() 函数
- python函数 cmp() type() str() repr()和 ''
- python 的repr和str以及“”
- Python内建函数str()和repr()
- python之repr()和str()的区别
- python中repr和 str的异同
- python str和repr 的区别
- python str和repr的区别
- 多行文本溢出显示省略号
- 推荐系统入门
- 存储过程小记
- 指针
- 练习
- Python学习笔记-str和repr
- layout文件夹中activity_main.xml与fragment_main.xml文件的处理记录
- 如何使用Android系统自带的VPN服务框架
- 继承条件下构造方法的调用规则
- 第2周 项目2 胖子不想说体重
- 商人的诀窍
- 自学Windows常用命令
- ccf 目录格式转换
- CentOS Nginx80端口不通