stringFormatting.py源代码分析
来源:互联网 发布:淘宝网刷q币 编辑:程序博客网 时间:2024/05/18 00:55
integerValue = 4237
print "Integer ", integerValue
print "Decimal integer %d" % integerValue
print "Hexadecimal integer %x/n" % integerValue
#整形的两种打印格式:%d和%x
floatValue = 123456.789
print "Float", floatValue
print "Default float %f" % floatValue
print "Default exponential %e/n" % floatValue
#浮点型有两种打印格式:%f和%e
print "Right justify integer (%8d)" % integerValue
print "Left justify integer (%-8d)/n" % integerValue
#左右调整整数的位置
stringValue = "String formatting"
print "Force eight digits in integer %.8d" % integerValue
print "Five digits after decimal in float %.5f" % floatValue
print "Fifteen and five characters allowed in string:"
print "(%.15s) (%.5s)" % ( stringValue, stringValue )
#字符串打印的格式:为%s
- stringFormatting.py源代码分析
- fibonacci.py源代码分析
- builddialectexamples.py源代码分析
- plural.py源代码分析
- regression.py源代码分析
- apihelpertest.py源代码分析
- argecho.py源代码分析
- soundex.py源代码分析
- plural1.py源代码分析
- toolbox.py源代码分析
- sum.py源代码分析
- operator.py源代码分析
- average.py源代码分析
- square.py源代码分析
- classAverage.py源代码分析
- examResult.py源代码分析
- while.py源代码分析
- for.py源代码分析
- window.open
- 内排序算法的java实现---直接选择排序
- AbstractCommandControl
- Dreamweaver 快捷键 一览表
- 118
- stringFormatting.py源代码分析
- c#的类型
- 关于点击startup.bat启动tomcat的问题
- 代码之余,随便说说——BPS
- LPAD & RPAD
- C++从零开始(二)——何谓表达式
- 大家来学宁乡话!
- PHP OOP注意点(一)
- C++从零开始(三)——何谓变量