python 格式化输出
来源:互联网 发布:网络测线仪 编辑:程序博客网 时间:2024/05/17 02:30
string的格式化输出方式
第一种方式:format函数
a="hello world"
format(a,"*^20")
输出:****hello world*****
第二种方式: %
'%-20s' % a或者 '%20s' % a
第三种方式: ljust,rjust函数
>>> text.rjust(20,'=')
'=========Hello World'
>>> text.center(20,'*')
'****Hello World*****'
'======================待续======================'
0 0
- python中的格式化输出
- python 格式化输出
- python 格式化输出
- python格式化dict输出
- python格式化输出
- python 格式化输出
- Python 的格式化输出
- python 字符串格式化 输出
- Python格式化输出
- Python print 格式化输出
- python 格式化输出
- python 格式化输出
- python格式化输出
- python格式化输出
- python 格式化输出
- Python格式化输出
- [python]格式化输出
- python print格式化输出
- android IPC通信中的UID和PID识别(远程调用/本地调用)
- cocos2d-x坐标系统
- Blocks:Capturing automatic variables
- Dpkg
- 如何从零开始开发一款嵌入式产品(20年的嵌入式经验分享学习) .
- python 格式化输出
- Ubuntu下编译vlc源码
- 大话世界格局:春秋五霸与战国七雄
- 上班一周了
- TC SRM590 p1000
- 微信5.1更新,有新功能
- 和菜鸟一起学产品之交互式设计
- 天天飞车重磅推出
- GC之---MaxTenuringThreshold参数