Just need explanation understanding 1 simple line of code. : <p>I was studying a coding challenge in which you need to write a function that counts duplicate occurrences of character patterns in a string and returns how many times it occurs. For example if string is s = 'catcatcat', output is 3. If string s = 'abcdabcd', output is 2. If s = 'catcatcatcatcat', output is 5.The answer ended up being</p>

<pre><code>def function(s):
   return max([s.count(s[:x]) for x in range(len(s)) if s[:x]*s.count(s[:x]) == s])
</code></pre>

<p>Can anyone help explain this code because im having trouble understanding. Btw just started learning python. </p>
