漫漫长路,其修远兮!
发布时间:2014-04-01 18:04:32
1.格式化为字符串%s >>> format = "Hello, %s. %s enough for ya?">>> values = ('world', 'Hot')>>> print format % valuesHello, world. Hot enough for ya?2.格式化为实数%f>>> format = "Pi with three decimals: %.3f"//保留小数点后3个有效数字>>> from math import pi//导入pi的值>>> print format % .........【阅读全文】