On Thu, 4 Sep 2008, Robert Berman wrote:
> Time to do some reading about regex. And here I thought I was slick
> working with lists and strings.
You shouldn't need a regexp for this. An easy way to count the trailing
zeros is:
- convert the number to a string;
- make a copy, stripping off the trailing zeroes, using rstrip('0')
- compare the lengths of the two strings
The difference in the lengths is the number of trailing zeroes.
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor