Working with Dates and Times in Python: Optional question on screen 11

Screen Link:

Question: Find the visitor who spent the most amount of time at the White House?

My answer: Alan C. Prather

First, please tell me whether my answer is correct?

Second, I’d like to know if there’s better approach to arrive at the answer?

My approach:
Step 1 - I created a dictionary with unique visitor names as keys and their cumulative meeting durations as values.

Step 2 - I reversed the keys and values to create another dictionary so that I can use the max function to find out the maximum cumulative duration of meetings and the corresponding visitor, which would be our answer.

Your answer does look to be correct as per my own solution.

You don’t need to reverse the keys and values to get the answer. Google something like:

python dictionary max value key

and see what results you get that could simplify your 2nd step.