On 31 oct, 16:58, Abandoned <[EMAIL PROTECTED]> wrote:
> Hi..
> I want to do this:
> for examle:
> 12332321 ==> 12.332.321
>
> How can i do?

>>> x = 12332321
>>> '.'.join(''.join(i for n, i in g) for k, g in 
>>> groupby(enumerate(reversed(str(x))), lambda (n, i): n//3))[::-1]
'12.332.321'
>>>

--
Roberto Bonvallet

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to