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 return15get_last_watch_time("[email protected]", "A Journey into the Quantum Banana")should return30get_last_watch_time("[email protected]", "Cats in Space and Intergalactic Cheese")should return5get_last_watch_time("[email protected]", "Cats in Space and Intergalactic Cheese")should return0get_last_watch_time("[email protected]", "Time-Traveling Penguins and Singing Tacos")should return0get_last_watch_time("[email protected]", "Time-Traveling Penguins and Singing Tacos")should returnNone
Getting Started with Python
Data Types
Python Functions
Statements in Python
Basic Debugging in Python
Basic Algorithm
Object-Oriented Programming
Error Handling
Intermediate Algorithm
Python Modules