def printDetailedStatistic(self):
        """ prints a statistic per session key. The session key includes the
            math operation, how many numbers, the digits for the numbers
            and how many tasks; this is to have comparable sessions.
        """
        for key, sessions in self.sessionsByKey.items():
            print("\n...separate statistic for %s" % key)
            succeeded, failed = 0, 0
            taskDurations     = []
            sessionDurations  = []
            lastSession       = None

            for session in sessions:
                sessionDurations.append(session.getDuration())
                for task in session:
                    taskDurations.append(task.getDuration())

                    if task.isValid():
                        succeeded += 1
                    else:
                        failed += 1

                if not lastSession:
                    lastSession = session
                elif session.finished > lastSession.finished:
                    lastSession = session

            errorRate = failed * 100.0 / len(taskDurations)

            print("......last session has been %s"
                  % (Tools.dateBack(lastSession.finished) + " ago"))
            print("......number of sessions is %d"
                  % len(sessionDurations))
            print("......number of tasks is %d, %d succeeded, %d failed - error rate is about %.1f%%"
                  % (len(taskDurations), succeeded, failed, errorRate))
            print("......best task time was %f seconds, longest task time was %f seconds"
                  % (min(taskDurations), max(taskDurations)))
            print("......best session time was %f seconds, longest session time was %f seconds"
                  % (min(sessionDurations), max(sessionDurations)))
            print("......average time over all tasks is %f seconds"
                  % (sum(taskDurations)/len(taskDurations)))
            print("......average time over all sessions is %f seconds"
                  % (sum(sessionDurations)/len(sessionDurations)))
            print("......sessions time %f seconds"
                  % (sum(sessionDurations)))
 prints a statistic per session key. The session key includes the
            math operation, how many numbers, the digits for the numbers
            and how many tasks; this is to have comparable sessions.
        
recipes/Python/578111_Learning_calculate_mental/recipe-578111.py