How to write to file the values returned by a function in python : Here the calc_property_statistics function returns maximum,minimum,average  values. I need to write them to a file. 

def calc_property_statistics(prop, realisation=0):
 
    values = prop.get_values(realisation)
    maximum = np.max(values)
    minimum = np.min(values)
    average = np.average(values)

    print("maximum: {}, minimum: {}, average: {} for property {}".format(
       maximum,
        minimum,
        average,
        prop))

    return (maximum, minimum, average)