Thursday, July 23, 2009


Python Simple Conversion:

The simple conversion, with only a conversion type, is really easy to use:

>>> 'Using str: %s' % 99L
'Using str: 99'

>>> 'Using repr: %r' % 99L
'Using repr: 99L'

>>> 'Price of eggs: $%d' % 42
'Price of eggs: $42'

>>> 'Hexadecimal price of eggs: %x' % 42
'Hexadecimal price of eggs: 2a'

>>> from math import pi
>>> 'Pi: %f...' % pi
'Pi: 3.141593...'

>>> 'Very inexact estimate of pi: %i' % pi
'Very inexact estimate of pi: 3'

No comments:

Data Science - 103 (Kapil Sharma)

Cloud Computing Basic:-  In this the PC is on service provider data center and secuirty maintenance and upgrades are done by the service pro...