Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #43589

Re: howto remove the thousand separator

References <201304150257331336590@gmail.com> <mailman.596.1365966380.3114.python-list@python.org> <516b49dc$0$29977$c3e8da3$5496439d@news.astraweb.com>
Date 2013-04-14 17:44 -0700
Subject Re: howto remove the thousand separator
From Mark Janssen <dreamingforward@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.611.1365986675.3114.python-list@python.org> (permalink)

Show all headers | View raw


On Sun, Apr 14, 2013 at 5:29 PM, Steven D'Aprano
<steve+comp.lang.python@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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: howto remove the thousand separator Mark Janssen <dreamingforward@gmail.com> - 2013-04-14 12:06 -0700
  Re: howto remove the thousand separator Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-15 00:29 +0000
    Re: howto remove the thousand separator Mark Janssen <dreamingforward@gmail.com> - 2013-04-14 17:44 -0700
      Re: howto remove the thousand separator Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-15 01:14 +0000
        Re: howto remove the thousand separator Chris Angelico <rosuav@gmail.com> - 2013-04-15 11:29 +1000
          Re: howto remove the thousand separator Walter Hurry <walterhurry@lavabit.com> - 2013-04-15 02:25 +0000
            Re: howto remove the thousand separator Roy Smith <roy@panix.com> - 2013-04-14 22:35 -0400
              Re: howto remove the thousand separator Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-15 07:04 +0000
        Re: howto remove the thousand separator Rotwang <sg552@hotmail.co.uk> - 2013-04-15 03:19 +0100
          Re: howto remove the thousand separator Ned Deily <nad@acm.org> - 2013-04-14 22:15 -0700
          Re: howto remove the thousand separator Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-15 07:03 +0000
            Re: howto remove the thousand separator Chris Angelico <rosuav@gmail.com> - 2013-04-15 17:39 +1000
            Re: howto remove the thousand separator Rotwang <sg552@hotmail.co.uk> - 2013-04-15 23:16 +0100

csiph-web