Request for feedback on my first Python program
Fernando Perez
fperez528 at yahoo.com
Mon Jun 2 14:50:05 EDT 2003
Martin Franklin wrote:
> as of Python 2.0 the string module is not needed (string's have methods...)
Not true. Until strings have _all_ the methods in the strings module, we'll
still need it:
In [8]: import string
In [9]: s='abc'
In [10]: string.zfill(s,9)
Out[10]: '000000abc'
In [11]: s.zfill(9)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
?
AttributeError: 'str' object has no attribute 'zfill'
Best,
f.
More information about the Python-list
mailing list