title: checking if for loop variable is at last index of string (not variable == string[index_Integer])
body: <p>I feel like I am doing something wrong with the for loop and the user input</p>
  
  <p>Whenever I do the for loop, I do believe that the local variable in the for loop has only one entry in the list</p>
  
  <pre><code>list[index_int] #returns value of the indexed entry in the list
  user_input = "1234"
  user_input[-1] &gt;&gt;&gt; 4
  
  
      def print_numbers(n):
      for entry in n:
          if entry == "1":
              if (entry == n[-1]):
                  print "E"
              else:
                  print entry + "s,",
          elif entry == "0":
              if (entry == n[-1]):
                  print "X"
              else:
                  print entry + "X,",
          else:
              if (entry == n[-1]): #applies if entry is equal to the value of user input       at index value of (-1), which I do not want
                  print entry + "L"
              else:
                  print entry + "s,",            
  user_input = raw_input()
  if user_input.isdigit():
      print_numbers(user_input)
  else:
      print user_input
  </code></pre>
  
  <p>When I wanted to put down 101 or 212, I get these </p>
  
  <pre><code>Intention -&gt; 1s, X, E
  Result:
  E
  X, E
  
  Intention -&gt; 2s, 1s, 2L
  Result:
  2L 
  1s, 2L
  </code></pre>
  
  <p>I do believe that the cause is that during the for loop, each variable has only one element in its own list.</p>
  
  <p>Is there not a way to check if the for loop is AT the list's (the string's) last index position (NOT having the variable equal to the value of the string's index i.e entry == n[-1])?</p>