Python format格式化输出
2016-04-25 13:39
525 查看
http://www.jb51.net/article/63672.htm
推荐参考
记住几个常用的用法就行,其余的要有个印象!
推荐参考
>>> '{0},{1}'.format('hello','python') 'hello,python' >>> '{0} {1}'.format('hello','python') 'hello python' >>> 'your name:{name}'.format(name='tom') 'your name:tom' >>> p=['123',45] >>> '{0[0]}{0[1]}'.format(p) '12345' >>> "{:>10}".format('1111') ' 1111'
记住几个常用的用法就行,其余的要有个印象!
相关文章推荐
- python p2p on esp8266
- 文章标题
- python两种生成md5的方法
- 怎么解决numpy和matplotlib无法安装问题
- Python配置OpenCV时报错:ImportError DLL load failed: %1 不是有效的 Win32 应用程序
- python读取csv文件
- python文件编码说明 coding
- caffe手写体模型调用python
- 用python导出csv文件
- 学习大数据第四天:最小二乘法的Python实现
- Python闭包
- python版本的读写锁操作方法
- python re 模块
- Python中的引用和拷贝浅析
- python2.X编码问题梳理
- Python简单实现enum功能的方法
- 初学python四:简单的输入输出
- 【LeetCode-345】Reverse Vowels of a String
- python 读取固定格式文件
- 初学python三:变量