title: Find median and mode from .txt file Python 3.4.1
body: <p>I am trying to determine the median and mode from a list of numbers in "numbers.txt" file. 
  I am EXTREMELY new to python and have ZERO coding experience. </p>
  
  <p>This is what I have so far calculating mean, sum, count, max, and min but I have no idea where to go from here. </p>
  
  <pre><code>number_file_name = 'numbers.txt'
  number_sum = 0
  number_count = 0
  number_average = 0
  number_maximum = 0
  number_minimum = 0
  number_range = 0
  
  do_calculation = True
  while(do_calculation):
  
      while (True):
          try:
              # Get the name of a file
              number_file_name = input('Enter a filename. Be sure to include .txt after the file name: ')
              random_number_count = 0
  
              print('')
  
              random_number_file = open(number_file_name, "r")
              print ('File Name: ', number_file_name, ':', sep='')
  
              print('')
  
              numbers = random_number_file.readlines()
              random_number_file.close
          except:
              print('An error occured trying to read', random_number_file)
          else:
              break
  
      try: 
          number_file = open(number_file_name, "r")
  
          is_first_number = True
  
          for number in number_file:
              number = int(number)  # convert the read string to an int
  
              if (is_first_number):
                  number_maximum = number
                  number_minimum = number
                  is_first_number = False
  
              number_sum += number
              number_count += 1
              if (number &gt; number_maximum):
                  number_maximum = number
              if (number &lt; number_minimum):
                  number_minimum = number
  
          number_average = number_sum / number_count
          number_range = number_maximum - number_minimum
  
          index = 0
          listnumbers = 0
          while index &lt; len(numbers):
              numbers[index] = int(numbers[index])
              index += 1
  
  
          number_file.close()
      except Exception as err:
          print ('An error occurred reading', number_file_name)
          print ('The error is', err)
      else:
          print ('Sum: ', number_sum)
          print ('Count:', number_count)
          print ('Average:', number_average)
          print ('Maximum:', number_maximum)
          print ('Minimum:', number_minimum)
          print ('Range:', number_range)
          print ('Median:', median)
  
      another_calculation = input("Do you want to enter in another file name? (y/n): ")
      if(another_calculation !="y"):
          do_calculation = False
  </code></pre>