python find repeated substring in string
<p>I am looking for a function in Python where you give a string as input where a certain word has been repeated several times until a certain length has reached. </p>

<p>The output would then be that word. The repeated word isn't necessary repeated in its whole and it is also possible that it hasn't been repeated at all.</p>

<p>For example: </p>

<pre><code>"pythonpythonp" =&gt; "python"

"hellohello" =&gt; "hello"

"appleapl" =&gt; "apple"

"spoon" =&gt; "spoon"
</code></pre>

<p>Can someone give me some hints on how to write this kind of function?</p>