def overallAnalytics(self): print('Total number of entries: ', end=' ') print(len(self.wordCountOfEntriesDict)) print('First entry: ', end=' ') print(Helper.prettyPrintDate(self.firstDate)) print('Last entry: ', end=' ') print(Helper.prettyPrintDate(self.mostRecentDate)) print('Total days from first to last entry: ', end=' ') totalDays = self.mostRecentDate - self.firstDate #this is correct days = totalDays.days print(days) print('Percentage of days from first to last with an entry: ', end=' ') print(str(round(float(len(self.wordCountOfEntriesDict)) / days * 100, 2)) + '%') print('Average length per entry: ', end=' ') numberOfEntries = len(self.wordCountOfEntriesDict) sumOfLengths = 0 longestEntryLength = 0 for date in list(self.wordCountOfEntriesDict.keys()): length = self.wordCountOfEntriesDict[date] if length > longestEntryLength: longestEntryLength = length longestEntryDate = date sumOfLengths += length print(round(float(sumOfLengths) / numberOfEntries, 2)) print('Longest entry: ' + str(longestEntryLength) + ' words on ', end=' ') print(Helper.prettyPrintDate(longestEntryDate)) print('Total number of words written: ', end=' ') print(locale.format("%d", self.totalNumberOfWords, grouping=True))