title: Search File And Find Exact Match And Print Line?
body: <p>I searched around but i couldn't find any post to help me fix this problem, I found similar but i couldn't find any thing addressing this alone anyway.</p>
  
  <p>Here's the the problem I have, I'm trying to have a python script search a text file, the text file has numbers in a list and every number corresponds to a line of text and if the raw_input match's the exact number in the text file it prints that whole line of text. so far It prints any line containing the the number.</p>
  
  <p>Example of the problem, User types <code>20</code> then the output is every thing containing a <code>2</code> and a <code>0</code>, so i get <code>220 foo</code> <code>200 bar</code> etc. How can i fix this so it just find "20"</p>
  
  <p>here is the code i have</p>
  
  <pre><code>num = raw_input ("Type Number : ")
  search = open("file.txt")
  for line in search:
   if num in line:
    print line 
  </code></pre>
  
  <p>Thanks. </p>