Python的format格式化输出
Python的格式化输出
方法一:传统方法
与C语言类似,可以采用“%”作为格式化输出的标记。如:
print("The first number: %5d, the second number: %8.2f" % (123, 456.789))
输出的结果为:
The first number: 123, the second number: 456.79
不用做更多解释,分为3个部...
转载
2019-04-23 21:41:37 ·
769 阅读 ·
0 评论