title: Finding integers in a file
body: <p>I need to find integers of a file. I need to get the average of these ints (I already have this part figured out). I get the error: "error on input []: Can't convert 'int' object to str implicitly"</p>
  
  <p>EDIT - Code is working. Thank you everyone! DiCaprio helped me to come up with final solution.</p>
  
  <p>I edited my final code to be this:</p>
  
  <pre><code>   def average_ints():
          integers = []
          num_ints = 0
          avg = 0
          with open("file") as f:
              for line in f:
                  for i in line.split(' '):
                       integers.append(int(i))
                      num_ints = num_ints + 1
          avg = (sum(integers))/((num_ints))
          return avg
  </code></pre>
  
  <p>How can I find the integers of this file?</p>