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


Groups > comp.lang.python > #43083

Re: Splitting of string at an interval

References (2 earlier) <mailman.263.1365390121.3114.python-list@python.org> <roy-024D82.09215608042013@news.panix.com> <CAJ6cK1aWX3cPxFaHgqd=YJAJSmbA3b+mj4TYuEiW0cUCBtiabA@mail.gmail.com> <D77F906C-B07F-4A6B-B0E0-05B94AA006CE@panix.com> <CAPTjJmqMZPr3qEO5-w6EVTT5fko0Yo3smSomgNJyysOJzmwGvQ@mail.gmail.com>
Date 2013-04-08 17:30 +0100
Subject Re: Splitting of string at an interval
From Arnaud Delobelle <arnodel@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.295.1365438635.3114.python-list@python.org> (permalink)

Show all headers | View raw


On 8 April 2013 17:20, Chris Angelico <rosuav@gmail.com> wrote:
> On Tue, Apr 9, 2013 at 1:37 AM, Roy Smith <roy@panix.com> wrote:
>> I can't help point out, however, that if your initial implementation is to have your code return a constant, it's pretty likely to be an optimum solution in both time and space :-)
>
> Likely, but not certain.
>
> # 1
> def fifty_stars():
>   return "**************************************************"
>
> # 2
> fifty_stars=lambda "*"*50

There's a whole competition about writing the smallest program which
outputs the song "99 bottles of beer":

http://codegolf.com/99-bottles-of-beer

Cheers,

-- 
Arnaud

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


Thread

Splitting of string at an interval subhabangalore@gmail.com - 2013-04-07 13:25 -0700
  Re: Splitting of string at an interval Dave Angel <davea@davea.name> - 2013-04-07 16:46 -0400
  Re: Splitting of string at an interval Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-07 21:48 +0000
    Re: Splitting of string at an interval Chris Angelico <rosuav@gmail.com> - 2013-04-08 13:01 +1000
      Re: Splitting of string at an interval Roy Smith <roy@panix.com> - 2013-04-08 09:21 -0400
        Re: Splitting of string at an interval Arnaud Delobelle <arnodel@gmail.com> - 2013-04-08 16:10 +0100
        Re: Splitting of string at an interval Roy Smith <roy@panix.com> - 2013-04-08 11:37 -0400
        Re: Splitting of string at an interval Chris Angelico <rosuav@gmail.com> - 2013-04-09 02:20 +1000
        Re: Splitting of string at an interval Arnaud Delobelle <arnodel@gmail.com> - 2013-04-08 17:30 +0100
          Re: Splitting of string at an interval Roy Smith <roy@panix.com> - 2013-04-08 21:09 -0400
            Re: Splitting of string at an interval Tim Chase <python.list@tim.thechases.com> - 2013-04-08 20:42 -0500
            Re: Splitting of string at an interval Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-09 02:38 +0000
              Re: Splitting of string at an interval Andrew Berg <bahamutzero8825@gmail.com> - 2013-04-08 21:57 -0500
              Re: Splitting of string at an interval Chris Angelico <rosuav@gmail.com> - 2013-04-09 14:22 +1000
              Re: Splitting of string at an interval Dave Angel <davea@davea.name> - 2013-04-09 02:28 -0400
        Re: Splitting of string at an interval Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-04-08 19:15 -0400

csiph-web