Editor settings

General settings

Save settings

Learn to program with Python

Get last watch time #

Given a dictionary of users and their watching history, write a function that retrieves the last watch time for a specific user and video. If the user hasn't watched the video, return 0. If the user doesn't exist, return None.


Tests #

  • Do not change the given dictionary
  • get_last_watch_time("[email protected]", "A Journey into the Quantum Banana") should return 15
  • get_last_watch_time("[email protected]", "A Journey into the Quantum Banana") should return 30
  • get_last_watch_time("[email protected]", "Cats in Space and Intergalactic Cheese") should return 5
  • get_last_watch_time("[email protected]", "Cats in Space and Intergalactic Cheese") should return 0
  • get_last_watch_time("[email protected]", "Time-Traveling Penguins and Singing Tacos") should return 0
  • get_last_watch_time("[email protected]", "Time-Traveling Penguins and Singing Tacos") should return None
Output will be displayed here