title: Trying to make an algorithm that checks a string, then outputs the longest substring
body: <p>the only catch is that is has to be in alphabetical order: Where the unicode value is bigger than the previous character. If i have a string with the letters "owdnloquxat" then it would only print "loqux" since this is the longest substring in alphabetical order.</p>
  
  <p>I've tried this code. However, in this instance it only prints "az", but it should print "beggh"</p>
  
  <pre class="lang-py prettyprint-override"><code>s = 'azcbobobegghakl'
  sList = list(s)
  
  sub = s[0]
  
  long, lenght = sub, 1
  
  for i in s[1:]:
      if ord(sub[-1]) &lt;= ord(i):
          sub += i
      print(sub)
  </code></pre>
  
  <p>I am quite new to python, but need to complete this for a course. If you want to give answers, that's fine. Hints would be fine as well since i want to learn.</p>