integerValue = 4237print "Integer ", integerValueprint "Decimal integer %d" % integerValue print "Hexadecimal integer %xn" % integerValuefloatValue = 123456.789print "Float", floatValueprint "Default float %f" % floatValueprint "Default exponential %en" % floatValueprint "Right justify integer (%8d)" % integerValueprint "Left justify integer (%-8d)n" % integerValuestringValue = "String formatting"print "Force eight digits in integer %.8d" % integerValueprint "Five digits after decimal in float %.5f" % floatValueprint "Fifteen and five characters allowed in string:"print "(%.15s) (%.5s)" % ( stringValue, stringValue )
Name (required)
email (will not be published) (required)
Website