I have a for loop:
for x in range(1,13): print (\"This was the average temperature in month number \" + str(x) + \" in Boston, 2014: \", Boston_monthly_te
You could simply store the results in a dictionary, pickle that and store it:
import pickle d = {} for x in range(1,13): d[x] = Boston_monthly_temp(x) res = pickle.dumps(d) # write res to a file