title: comparison within loop while maintaining value
body: <p>I am trying to make a python program that<br>
  1. compares the first and last letter of a word<br>
  2. tell whether the words inputted to the program are in alphabetical order </p>
  
  <p>e.g.) alaska baobab cadillac => would pass
  e.g.) alaska baobab greg => would not pass</p>
  
  <p>my code is shown below</p>
  
  <pre><code>num_words = int(input())
  
  while num_words &gt; 0:
      my_word = str(input())
      num_words -= 1
  
      alphabet_order = ord(my_word[0].lower())
  
      if my_word[0].lower() != my_word[-1].lower() or alphabet_order != ord(my_word[0].lower()):
          print(my_word)
          break
      alphabet_order += 1
  
      if alphabet_order == ord('z') + 1:
          alphabet_order = ord('a')
  
  else:
      print('no mistake')
  </code></pre>
  
  <p>Hi everyone on stack.</p>
  
  <p>I am pretty new to programming and I am starting to find assigning variables within a loop very cumbersome.</p>
  
  <p>It seems like my variable alphabet_order keeps getting renewed every time when the loop takes in a new input.</p>
  
  <p>What would be a great way to steadily increase the alphabet_order variable by 1 while only renewing <code>ord(my_word[0])</code> every loop?</p>