I cant understand this code in Python, can you help me? : <p>I had a code assignment but i could'nt find the answer, so i check it on the net. the code is written in python. The code is absolutely right but i cannot understand it. I am pretty much new to python so plz help me.</p>

<p>Here is the question</p>

<p>Assume s is a string of lower case characters.</p>

<p>Write a program that prints the longest substring of s in which the letters occur in alphabetical order. For example, if s = 'azcbobobegghakl', then your program should print</p>

<p>Longest substring in alphabetical order is: beggh
In the case of ties, print the first substring. For example, if s = 'abcbcd', then your program should print</p>

<p>Longest substring in alphabetical order is: abc</p>

<p>The code is:</p>

<pre><code>    # initialise tracker variables
    maxLen=0
    current=s[0]
    longest=s[0]

    # step through s indices
    for i in range(len(s) - 1):
    if s[i + 1] &gt;= s[i]:
        current += s[i + 1]
        # if current length is bigger update
        if len(current) &gt; maxLen:
            maxLen = len(current)
            longest = current
    else:
        current=s[i + 1]

    i += 1

print ('Longest substring in alphabetical order is: ' + longest)
</code></pre>
