I wrote a function on python that should print the sentences below.
def write_to_file(matrix, path): f = open(path, "w") f.write('\r\n') for i in range (2,5): item = (bestQuarterRate(matrix, i)) item = (str(item)) print item f.write(item) f.close()
The problem is that I get this:
('Highest quarter rate is between', '1/1/15', 'and', '1/3/15', 'with rate:', 924.9966666666666) ('Highest quarter average exchange change is between', '1/4/15', 'and', '1/6/15', 'with rate:', 598.1673333333333) ('Highest quarter volume is between', '1/4/13', 'and', '1/6/13', 'with rate:', 158.7078934137758)
and I need to change it to this:
Highest quarter rate is between 1/1/15 and 1/3/15 with rate: 924.996666667 Highest quarter average exchange is between 1/10/14 and 1/12/14 with rate: 1503.67333333 Highest quarter volume change rate is between 1/4/13 and 1/6/13 with rate: 158.707893414 The best year is 2014 with an average exchange value of: $1601932.83452
I would like to get any help.