title: check if a 5-digit number is in a list based on place value
body: <p>In Python, I am trying to compare a list of 10 5-digit numbers to three 5-digit number inputted by a user. 
  For example, if one of the numbers in the list was 46590 and the user inputted 46509 it would show that the user only got the first three numbers correct.</p>
  
  <p>The list is in a txt file. Here's what I have coded so far:</p>
  
  <pre><code>name = input("Enter the file name: ")
  
  
  number1 = str(input("Enter in your first lottery ticket: "))
  number2 = str(input("Enter in your second lottery ticket: "))
  number3 = str(input("Enter in your third lottery ticket: "))
  
  f=open("lottery.txt")
  exs=f.readlines()
  exs = [x for x in exs if x.strip()]
  mylist = [line.rstrip('\n') for line in exs]
  
  for line in mylist:
      if line == number1:
          print("entire number equal")
      elif line[0][0] == number1[0]:
          print("first digit equal")
      elif line[0][0] == number1[0] and line[1][0] == number1[1]:
          print("first and second digit equal")
      elif line[0][0] == number1[0] and line[1][0] == number1[1] and line[2][0] == number1[2]:
          print("First second and third digit equal")
  </code></pre>
  
  <p>I tried using Boolean expressions but I kept getting error messages. Now, when I run the code above it prints out "first digit equal" twice. </p>
  
  <p>Thanks in advance!</p>