Conversation
jericahuang
left a comment
There was a problem hiding this comment.
Excellent first project, Alma! This project is green. 🟢
You implemented every function according to the specification and had fantastic code style throughout. Very great use of helper functions, set logic, and parsing nested data structures. Nice job finishing out the tests as well. See my line-by-line comments for more detail. Keep up the great work!
|
|
||
| raise Exception("Test needs to be completed.") | ||
| #Mine below: | ||
| assert updated_data["watched"][0]['title'] == MOVIE_TITLE_1 |
|
|
||
| raise Exception("Test needs to be completed.") | ||
| #Mine teste below: | ||
| assert updated_data["watched"][-1]['title'] == movie_to_watch["title"] |
There was a problem hiding this comment.
👍🏻 Nice use of index -1 to access the last element!
| # ************************************************************************************************* | ||
| # ****** Add assertions here to test that the correct movies are in friends_unique_movies ********** | ||
| # ************************************************************************************************** | ||
| assert INTRIGUE_3 in friends_unique_movies |
| recommendations = get_new_rec_by_genre(sonyas_data) | ||
|
|
||
| # # # raise Exception("Test needs to be completed.") | ||
| assert len(recommendations) == 0 |
| new_movie = { } | ||
|
|
||
| # if an argument is None, return None | ||
| if title == None or genre == None or rating == None: |
There was a problem hiding this comment.
www.pythontutorial.net/advanced-python/python-none/) gives a good explanation why! It gets into how python objects' equality is defined, something we'll cover in OOP.
| return movies_only_final_list_dict | ||
|
|
||
| #*************************************************************************************************** | ||
| def get_friends_unique_watched(user_data): |
There was a problem hiding this comment.
Similar to above, wonderful implementation!
| for title in movies_only_final_list: | ||
| for friend in user_data['friends']: | ||
| for movie in friend['watched']: |
There was a problem hiding this comment.
Great parsing the nested data structure!
| friends_genre = [] | ||
| recommended_movies = [] | ||
|
|
||
| genre_max = get_most_watched_genre(user_data) |
There was a problem hiding this comment.
Great! A helper function is very helpful here.
| user_watched = user_data['watched'] #list,dict | ||
| friends = user_data['friends'] | ||
| user_genre = [] | ||
| friends_genre = [] | ||
| recommended_movies = [] |
| friends_users = [] | ||
| recommended_movies = [] | ||
|
|
||
| # if the user doesn't have favorites, it's equal length cero, then return an empty list. |
There was a problem hiding this comment.
Great comments outlining logical steps!
No description provided.