找回密码
 注册
查看: 615|回复: 0

Python的printf怎么用?

[复制链接]
发表于 2005-7-9 17:51:43 | 显示全部楼层 |阅读模式
某教程上写道:
>>>print 'The value of 1/7 is approximately %5.3f.' %0.142857
输出结果为:
'The value of 1/7 is approximately  0.143

%后面的东西是什么意思呢?为什么这么用呢?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2025-7-23 23:57 , Processed in 0.024416 second(s), 16 queries .

© 2001-2025 Discuz! Team. Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表