Python基础笔记 Python基础笔记 1、print格式化输出 print(format(val,format_modifier)),比如: print(format(12,345678,"6.3f")); --输出数据占6位(位数不足时,左补空格),小数位为3位 print(format(12,345678,"6.3%")); --以百分比形式输入,其他控制符意义相同