Probably homework, you are a good man !
--
https://mail.python.org/mailman/listinfo/python-list
Denis McMahon writes:
> On Thu, 06 Nov 2014 15:14:05 +1100, Chris Angelico wrote:
> > On Thu, Nov 6, 2014 at 3:00 PM, Denis McMahon wrote:
> >> def baseword(s):
> >> """find shortest sequence which repeats to generate s"""
> >> return s[0:["".join([s[0:x]for k in range(int(len(s)/x)+1)])[0:
On Thu, 06 Nov 2014 15:14:05 +1100, Chris Angelico wrote:
> On Thu, Nov 6, 2014 at 3:00 PM, Denis McMahon
> wrote:
>> def baseword(s):
>> """find shortest sequence which repeats to generate s"""
>> return s[0:["".join([s[0:x]for k in range(int(len(s)/x)+1)])[0:len
>> (s)]for x in range(1,
On Thu, Nov 6, 2014 at 3:00 PM, Denis McMahon wrote:
> def baseword(s):
> """find shortest sequence which repeats to generate s"""
> return s[0:["".join([s[0:x]for k in range(int(len(s)/x)+1)])[0:len
> (s)]for x in range(1,len(s)+1)].index(s)+1]
That's hardly a PEP-8 compliant line, but I
On Thu, 06 Nov 2014 03:36:40 +, Denis McMahon wrote:
> On Wed, 05 Nov 2014 18:49:01 +, MRAB wrote:
>
>> It doesn't work for the final example or "barbaz".
>
> Oh, and we really need a private "python homework answers" list where we
> can discuss the most pythonic solution we can think of
On Thu, Nov 6, 2014 at 2:36 PM, Denis McMahon wrote:
> On Wed, 05 Nov 2014 18:49:01 +, MRAB wrote:
>
>> It doesn't work for the final example or "barbaz".
>
> Oh, and we really need a private "python homework answers" list where we
> can discuss the most pythonic solution we can think of for a
On Wed, 05 Nov 2014 18:49:01 +, MRAB wrote:
> It doesn't work for the final example or "barbaz".
Oh, and we really need a private "python homework answers" list where we
can discuss the most pythonic solution we can think of for all these
homework / coursework questions without showing the
On Wed, 05 Nov 2014 18:49:01 +, MRAB wrote:
> On 2014-11-05 18:05, C@rlos wrote:
>> I thing this work:
>>
>> stg='pythonpython'
>> foundationline=stg[ 0:( stg [ 1: ].index( stg[ 0 ])+1 ) ]
>>
> It doesn't work for the final example or "barbaz".
I have two algorithms I've implemented.
Still n
On 2014-11-05 18:05, C@rlos wrote:
I thing this work:
stg='pythonpython'
foundationline=stg[ 0:( stg [ 1: ].index( stg[ 0 ])+1 ) ]
It doesn't work for the final example or "barbaz".
--
https://mail.python.org/mailman/listinfo/python-list
I thing this work:
stg='pythonpython'
foundationline=stg[ 0:( stg [ 1: ].index( stg[ 0 ])+1 ) ]
On 2014-11-05 11:58, lordvita...@gmail.com wrote:
> I have line 'pythonpythonpyth'. How do I know which word is the foundation
> line?.
> Other examples:
> "pythonpythonpyth" is python
> "DOLOR
On 2014-11-05 11:58, lordvita...@gmail.com wrote:
I have line 'pythonpythonpyth'. How do I know which word is the foundation
line?.
Other examples:
"pythonpythonpyth" is python
"DOLORIUMD" is DOLORIUM
"HELLOLHELLO" is HELLOL
"thewordword" is thewordword
I need to know whether the word in the te
On Wed, 05 Nov 2014 03:58:33 -0800, lordvital21 wrote:
> I have line 'pythonpythonpyth'. How do I know which word is the
> foundation line?.
> Other examples:
> "pythonpythonpyth" is python "DOLORIUMD" is DOLORIUM "HELLOLHELLO" is
> HELLOL "thewordword" is thewordword
>
> I need to know whether t
lordvita...@gmail.com wrote:
> I have line 'pythonpythonpyth'. How do I know which word is the foundation
> line?. Other examples:
> "pythonpythonpyth" is python
> "DOLORIUMD" is DOLORIUM
> "HELLOLHELLO" is HELLOL
> "thewordword" is thewordword
>
> I need to know whether the word in the text is r
On Wed, Nov 5, 2014 at 10:58 PM, wrote:
> I have line 'pythonpythonpyth'. How do I know which word is the foundation
> line?.
> Other examples:
> "pythonpythonpyth" is python
> "DOLORIUMD" is DOLORIUM
> "HELLOLHELLO" is HELLOL
> "thewordword" is thewordword
>
> I need to know whether the word in
14 matches
Mail list logo