.format 格式化函数

Python2.6 开始,新增了一种格式化字符串的函数 str.format(),它增强了字符串格式化的功能。

例:

结果:

例:

结果:

例:

扫描二维码关注公众号,回复: 4677246 查看本文章

结果:

猜你喜欢

转载自blog.csdn.net/weixin_40849273/article/details/85284118