Python Dates and Times in Python Let's Build a Timed Quiz App Taking The Quiz

.a{fill-rule:evenodd;}techdegree seal-36
UX Design Techdegree Graduate 28,226 Points

Point of "question_start" and question_end" times in "ask" method.


In the quiz class. The method "ask" calculates question start and question end times difference. I don't see Kenneth using the returned time difference inside the "take_quiz" method.

Also, I noticed more than one value (correct and time difference) is being returned in "ask" method. How do you access that?

1 Answer

Chris Freeman
Chris Freeman
Treehouse Moderator 59,892 Points

Good question. Kenneth defines the ask method to return a tuple of correctness, and time used for each question. The correctness is accessed using answer[0]. The individual question time could be accessed using answer[1], but he opted not to. Instead he’s calculating the overall time rather than looping and adding up the individual times.

Perhaps the individual time data might be used for another purpose later on.

Post back if you need more help. Good luck!!!