On Sun, Jul 24, 2011 at 1:12 AM, Billy Mays <no...@nohow.com> wrote: > On 7/23/2011 3:42 AM, Chris Angelico wrote: >> >> int(s.rstrip('0').rstrip('.')) >> > > Also, it will (in?)correct parse strings such as: > > '165............00000000000000' > > to 165.
Yes, it will, but is that an issue to the OP? Programming is about solving the problem you have, not the problems you don't have. Sometimes it's better to have a simple solution that does the job than an extremely complex one that isn't excessively lenient. Is it such a problem for it to be lenient? ChrisA -- http://mail.python.org/mailman/listinfo/python-list