how to improve this simple block of code

Peter Otten __peter__ at web.de
Wed Jan 11 09:19:53 EST 2006


hanz wrote:

> Or combined:
> 
> x = x.rstrip('0.') # removes trailing zeroes and dots

>>> "130.00".rstrip("0.")
'13'

Oops.

Peter



More information about the Python-list mailing list