title: Python How do I find if an number is in a list but is not last number of the list?
body: <p>I have a list of numbers and want to know if a number is in the list but is not the last number in the list. Maybe something like this?</p>
  
  <pre><code>for i in all_guesses:
          if guess == i:
              if guess != all_guesses[-1]:
              #Code here
  </code></pre>