title: How to create pairs from a text file that is a number and the word that precedes that number?
body: <p>I am working on a new project and the team I was assigned to is all Python. I am not that proficient in Python so I thought I'd turn to stackoverflow for help. My portion of the project is to Write a program that reads a text file and creates pairs from everything it finds in the file that is a number and the word that precedes that number. The only thing I have done is get the program to read the text file and print the whole thing. But I do not know how to get it to spit back pairs that is a number and the word that precedes it. Any help is appreciated! Thank you.</p>
  
  <p>Text file contents example:</p>
  
  <pre><code>I have 3 apples.
  The apples were very good.
  I ate 7 bananas.
  The bananas were just as good.
  </code></pre>
  
  <p>Desired output: </p>
  
  <pre><code>have, 3
  ate, 7
  </code></pre>
  
  <p>My code so far:</p>
  
  <pre><code>in_file = open("FILE.txt", "rt")  
  contents = in_file.read()       
  in_file.close()                  
  print(contents)
  </code></pre>
  
  <h2>(LOGIC THAT SENDS BACK PAIRS THAT IS A NUMBER AND THE WORD THAT PRECEDES IT)</h2>