title: Comparing list values (numbers, order matters) in Python
body: <p>I tried looking for the answer for this everywhere, I'm sure it is really simple, but somehow I can't make it work.</p>
  
  <p>I have two lists, which have exactly the same quantity of values, and I want to know how many of those match exactly value and position. This is the code I have been using:</p>
  
  <pre><code>ListA = [1, 2, 3, 4, 5]
  
  solved = 0
  
  While solved == 0:
     rr = 0
     i = 0
  
     userinput = input("Enter a 5 digit number):")
     ListB = []
  
     for u in userinput:
          ListB.append(u)
  
     While i &lt; 5:
          if ListA[i] == ListB[i]:
              rr = rr + 1
     print(rr)
     solved = 1
  </code></pre>
  
  <p>The output I'm looking for is, for example, if the input is 12763, 2, but it never seems to evaluate the if as true, so it never adds 1 to <code>rr</code>.
  I tried a for loop and variations of this setup, but I can't see where I am wrong.</p>
  
  <p>Thanks a lot for your time!</p>