title: Searching CSV file and if it's not in the file
body: <p>I have a CSV file filled with ticket information. I created a small script to input ticket numbers separated by spaces into a list which searches the CSV file for each ticket in the list, and if it finds the ticket, it outputs info on that row.</p>
  
  <p>My problem is if I search for a ticket not in the CSV file, it just skips past it and moves on, but I would like it to tell me that that ticket is not in the file. From what I can tell, it's searching the CSV file by row or line. If I try an <code>else</code> statement, it will start printing out every line in the CSV file, if that ticket's not in the row.</p>
  
  <p>I need to be able to input multiple ticket numbers and have python search each one individually. If it finds the ticket in column 1, then print information from that row and if it doesn't find the ticket in any rows column 1, then print out that ticket followed by "is not in the file".</p>
  
  <pre><code>import csv
  
  file = csv.reader(open('Path To CSV file', "rb"), delimiter=",")
  newticket = raw_input('Enter Ticket Numbers:').split()
  
  for line in file:
      for tickets in newticket:
          if tickets == line[1]:
              print(tickets, line[36], line[37])
  </code></pre>