-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cedar - Mac Madison #84
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job!
Really just one comment on style but overall your code is really elegant and easy to read!
""" | ||
Returns: | ||
new_movie (dict): A dictionary initialized with title (str), genre (str), and rating (float). | ||
Returns None if any parameters are falsy. | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice docstrings!
user_data (dict): The updated user_data with movie added to "watched" and movie removed from "watchlist". | ||
""" | ||
|
||
watch_list = user_data.get("watchlist") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice use of get
! 😃
new_movie = {"title": title, "genre": genre, "rating": rating} | ||
return new_movie |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally if I'm going to return it on the next line I don't assign to a variable:
new_movie = {"title": title, "genre": genre, "rating": rating} | |
return new_movie | |
return {"title": title, "genre": genre, "rating": rating} |
def get_user_titles(user_data): | ||
""" | ||
Returns: | ||
user_titles (set): A set containing all movie titles in user's "watched" list. | ||
""" | ||
|
||
user_titles = set([movie.get("title") for movie in user_data.get("watched")]) | ||
return user_titles |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice helper function. 😃
No description provided.