Conversation
spitsfire
left a comment
There was a problem hiding this comment.
great job on your first project, Andrea! I made a couple suggestions about pulling some functions apart and turning them into helper functions, but all in all you did amazing!
| @@ -0,0 +1,130 @@ | |||
| #wave 1 | |||
| def create_movie(movie_title,genre,rating): | |||
| else: | ||
| return None | ||
|
|
||
| def add_to_watched(user_data,movie_title): |
| watched_list.append(movie_title) | ||
| return user_data | ||
|
|
||
| def add_to_watchlist(user_data,movie_title): |
| movies_watched = user_data['watched'] | ||
| movies_to_watch = user_data['watchlist'] |
There was a problem hiding this comment.
nicely done making variables that help isolate and describe what kind of data you are working with
|
|
||
| for movie in movies_to_watch: | ||
| if movie_title == movie['title']: | ||
| movies_watched.append(movie) |
There was a problem hiding this comment.
this is a very redundant suggestion since this is only one line of code and thus works just fine, but where have we seen this before?
maybe we could use add_to_watched to do this for us. Again, suuuper unnecessary change to make in the scheme of things, so think of this as just something to consider for next time.
| if movie["genre"] == user_most_watched_genre: | ||
| if movie not in movie_recs_list: | ||
| movie_recs_list.append(movie) |
There was a problem hiding this comment.
we could put this into a compound conditional statement:
| if movie["genre"] == user_most_watched_genre: | |
| if movie not in movie_recs_list: | |
| movie_recs_list.append(movie) | |
| if movie["genre"] == user_most_watched_genre and movie not in movie_recs_list: | |
| movie_recs_list.append(movie) |
| if movie["host"] in host: | ||
| if movie not in rec_list: | ||
| rec_list.append(movie) |
There was a problem hiding this comment.
we could put this into a compound conditional statement:
| if movie["host"] in host: | |
| if movie not in rec_list: | |
| rec_list.append(movie) | |
| if movie["host"] in host and movie not in rec_list: | |
| rec_list.append(movie) |
| if movie not in movie_recs_list: | ||
| movie_recs_list.append(movie) | ||
| return movie_recs_list | ||
| def get_rec_from_favorites(user_data): |
| movie_recs_list.append(movie) | ||
| return movie_recs_list | ||
| def get_rec_from_favorites(user_data): | ||
| user_unique_list = get_unique_watched(user_data) |
| # def get_new_rec_by_genre(user_data): | ||
| # recommended_genre = [] | ||
| # new_list = [] | ||
| # fave_genre = get_most_watched_genre(user_data) | ||
| # for movie in user_data["friends"]: | ||
| # for i in movie["watched"]: | ||
| # new_list.append(i) | ||
| # for movie in new_list: | ||
| # if movie["genre"] == fave_genre: | ||
| # recommended_genre.append(movie) | ||
| # return recommended_genre | ||
| # def get_rec_from_favorites(user_data): | ||
| # recs_from_faves = [] | ||
| # unique_watched_list = get_unique_watched(user_data) | ||
| # faves = user_data["favorites"] | ||
| # for movie in unique_watched_list: | ||
| # if movie in faves: | ||
| # recs_from_faves.append(movie) | ||
| # return recs_from_faves | ||
| # def get_new_rec_by_genre: No newline at end of file |
There was a problem hiding this comment.
| # def get_new_rec_by_genre(user_data): | |
| # recommended_genre = [] | |
| # new_list = [] | |
| # fave_genre = get_most_watched_genre(user_data) | |
| # for movie in user_data["friends"]: | |
| # for i in movie["watched"]: | |
| # new_list.append(i) | |
| # for movie in new_list: | |
| # if movie["genre"] == fave_genre: | |
| # recommended_genre.append(movie) | |
| # return recommended_genre | |
| # def get_rec_from_favorites(user_data): | |
| # recs_from_faves = [] | |
| # unique_watched_list = get_unique_watched(user_data) | |
| # faves = user_data["favorites"] | |
| # for movie in unique_watched_list: | |
| # if movie in faves: | |
| # recs_from_faves.append(movie) | |
| # return recs_from_faves | |
| # def get_new_rec_by_genre: |
Shoutout to Trinisha and Claire for your patience and guidance,much appreciated.