Python Code Take Home Final Exam

I need explain to professor about each step about the code. So I NEED REALLY SPECIFIC DESCRIPTION on each code.