Python基础笔记

1、print格式化输出

     print(format(val,format_modifier)),比如:

     print(format(12,345678,"6.3f"));     --输出数据占6位(位数不足时,左补空格),小数位为3位

     print(format(12,345678,"6.3%"));   --以百分比形式输入,其他控制符意义相同

posted on 2014-10-20 00:17  散落一地的青春  阅读(99)  评论(0编辑  收藏  举报