python学习笔记-输入输出

时间:2014-05-09 07:14:19   收藏:0   阅读:447

格式化输出

print(format(value,format_spec)),其中3为打印位数,2f为精度

print(format(12.2356, ‘3.2f‘))
print(format(0.23456,‘.1%‘))
D:\Python27\python.exe F:/Self-Study/python-study/input_output.py
12.24
23.5%


本文出自 “reed卢伟开技术学习博客” 博客,谢绝转载!

python学习笔记-输入输出,布布扣,bubuko.com

原文:http://luweikai.blog.51cto.com/1705672/1408657

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!