title: IndexError when checking if input is palindrome using while loop
body: <p>I'd like to know how do I check if an input is a palindrome with a while loop, using Python.</p>
  
  <p>Thanks:</p>
  
  <p>i tried this</p>
  
  <pre><code>i = 0
  n = len(msg_list)
  
  while i &lt; n:
      palindrome = msg_list[i]
      if palindrome == msg_list[-1]:
          print("Palindrome? True")
          msg_list.pop(-1)
      else:
          print("Palindrome? False")
      i=i+1
  </code></pre>
  
  <p>but at the end I receive an error message that the list index is out of range</p>