title: How to print a specific line from a file
body: <p>I am trying to print a specific line from the file "Scores", which is option B. This is my code:</p>
  
  <pre><code>print("Option A: Show all scores\nOption B: Show a record\nOption Q: Quit")
  decision = input("Enter A, B, C or Q: ")
  myFile = open("Scores.txt", "rt")
  if decision == "A":
      record = myFile.read()
      print(record)
      myFile.close()
  elif decision == "B" or decision == "b":
      playerName = input("Enter a player name to view their scores: ")
      record = myFile.read()
      answer = record.find(playerName)
      for line in answer:
          print(line)
  elif decision == "Q" or decision == "q":
      exit
  </code></pre>
  
  <p>I went for Option B, then I entered a player name that holds the score of the player, but it throws this error message:</p>
  
  <pre><code>line 12, in &lt;module&gt;
  for line in answer():
  TypeError: 'int' object is not callable
  </code></pre>