3 number and dot..

Abandoned besturk at gmail.com
Wed Oct 31 16:47:17 EDT 2007


On Oct 31, 10:38 pm, Paul McGuire <pt... at austin.rr.com> wrote:
> On Oct 31, 2:58 pm, Abandoned <best... at gmail.com> wrote:
>
> > Hi..
> > I want to do this:
> > for examle:
> > 12332321 ==> 12.332.321
>
> > How can i do?
> >>> x = (12332321,)
> >>> while (x[0]>0): x=divmod(x[0],1000)+x[1:]
> ...
> >>> x
> (0, 12, 332, 321)
> >>> ".".join(map(str,x[1:]))
>
> '12.332.321'
>
> -- Paul

It's very good thank you paul!




More information about the Python-list mailing list