Convert '165.0' to int

Frank Millman frank at chagford.com
Sun Jul 24 04:21:51 EDT 2011


On Jul 24, 10:07 am, Chris Angelico <ros... at gmail.com> wrote:
> On Sun, Jul 24, 2011 at 5:58 PM, Frank Millman <fr... at chagford.com> wrote:
> >  if int(dec) != 0:
> > to
> >    if [_ for _ in list(dec) if _ != '0']:
>
> if dec.rtrim('0')!='':
>
> ChrisA

I think you meant 'rstrip', but yes, neater and faster.

Thanks

Frank



More information about the Python-list mailing list