Some links that might be helpful for this story.
statistics module
datetime
namedtuple
Copyright 2022 Robin A. Reynolds-Haertle