howto remove the thousand separator

Mark Janssen dreamingforward at gmail.com
Sun Apr 14 20:44:28 EDT 2013


On Sun, Apr 14, 2013 at 5:29 PM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> On Sun, 14 Apr 2013 12:06:12 -0700, Mark Janssen wrote:
>
>> cleaned=''
>> for c in myStringNumber:
>>    if c != ',':
>>      cleaned+=c
>> int(cleaned)
>
> ....due to being an O(N**2)  algorithm.

What on earth makes you think that is an O(n**2) algorithm and not O(n)?

Mark



More information about the Python-list mailing list