title: Defining functions that gives min, max and average from an input text file (Python)
body: <p>I am trying to define a function that can give me these outputs below when i run any length or combination of integers through it.<br>
  so this is the question i have been given:</p>
  
  <p>write Python code to read in the input of the textfile 'input.txt', and for each line in input.txt, write out a new line in a new text file output.txt that computes the answer to some operation on a list of numbers.</p>
  
  <pre><code>If the input.txt file has the following:
  
  min: 1,2,3,5,6
  max: 1,2,3,5,6
  avg: 1,2,3,5,6
  
  Your program should generate an output.txt file as following:
  
  The min of [1, 2, 3, 5, 6] is 1
  The max of [1, 2, 3, 5, 6] is 6
  The avg of [1, 2, 3, 5, 6] is 3.4
  </code></pre>
  
  <p>This is my code so far:</p>
  
  <pre><code>textFile = open('input.txt', 'r+')
  numberList = []
  for line in textFile:
      numberList.append(line.split(','))
  for e in numberList:
      print e
  textFile.close()
  
  def minimum(mi):
      minimun = min(numberList)
      return minumum
  
  def maximum(ma):
      maximum = max(numberList)
      return maximum
  
  print minimum(numberList)
  print maximum(numberList)
  </code></pre>
  
  <p>there is a problem when i try to call my function and i'm not sure if the function has been defined wrong or if i am calling it wrong.
  thanks in advance.</p>