Mike Meyer wrote:
> "py" <[EMAIL PROTECTED]> writes:
>> Say I have...
>> x = "132.00"
>> but I'd like to display it to be "132" ...dropping the trailing
>> zeros...I currently try this
>
> The two-strip solution is cleaner, but:
>
>> if x.endswith("0"):
>> x = x[:len(x)-1]
> x = x[:-1]
> or
> del x[-1]
>
> both improve that one statement.
>>> del "it's tempting not to try"[-1]
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: object doesn't support item deletion
Just-pointing-out-what-does-not-work-ly yours
Peter
--
http://mail.python.org/mailman/listinfo/python-list