<html><body><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000"><div>I thing this work:<br><div><br></div>stg='pythonpython'<br>foundationline=stg[ 0:( stg [ 1: ].index( stg[ 0 ])+1 ) ]<br></div><div><br></div><div>On 2014-11-05 11:58, lordvital21@gmail.com wrote:<br>> I have line 'pythonpythonpyth'. How do I know which word is the foundation line?.<br>> Other examples:<br>> "pythonpythonpyth" is python<br>> "DOLORIUMD" is DOLORIUM<br>> "HELLOLHELLO" is HELLOL<br>> "thewordword" is thewordword<br>><br>> I need to know whether the word in the text is repeated and get it. This will be the key.<br>><br>Consider the first example.<br></div><div><br></div><div>If the foundation is the first 1 character 'p' and you repeat it enough<br>times you'll get 'pppppppppppppppp'.<br></div><div><br></div><div>This is the same length as the line.<br></div><div><br></div><div>Does it match the line? No.<br></div><div><br></div><div>OK.<br></div><div><br></div><div>If the foundation is the first 2 characters 'py' and you repeat it<br>enough times you'll get 'pypypypypypypypy'.<br></div><div><br></div><div>This is the same length as the line.<br></div><div><br></div><div>Does it match the line? No.<br></div><div><br></div><div>OK.<br></div><div><br></div><div>If the foundation is the first 3 characters 'py' and you repeat it<br>enough times you'll get 'pytpytpytpytpytpyt'.<br></div><div><br></div><div>This is longer than as the line, so truncate it to 'pytpytpytpytpytpy'.<br></div><div><br></div><div>Does it match the line? No.<br></div><div><br></div><div>OK.<br></div><div><br></div><div>Continue in this vein until you'll get a match. (The foundation might<br>in fact be the entire line.)<br></div><div><br></div><div>-- <br>https://mail.python.org/mailman/listinfo/python-list<br></div></div>
<br><html><body><hr align=LEFT size=1 width=630 color=Black noshade><p>III Escuela Internacional de Invierno en la UCI del 17 al 28 de febrero del 2014. Ver <a href=http://www.uci.cu/> www.uci.cu </a></body></html>

<br></body></html>