Conversation
jbieniosek
reviewed
Sep 22, 2021
jbieniosek
left a comment
There was a problem hiding this comment.
Great work on this project Kayla! Nice work with your helper function! This is a very solid project, and is green. You hit all of the learning goals. Fantastic work!
| if title == movie["title"]: | ||
| movie_to_watch.remove(movie) | ||
| movies_watched.append(movie) | ||
| return user_data #no else statement needed |
| for rating in user_data["watched"]: | ||
| ratings_total += (rating["rating"]) | ||
| list_count = (len(user_data["watched"])) | ||
| average = ratings_total/list_count |
| else: | ||
| for genre in user_data["watched"]: | ||
| genre_list.append((genre["genre"])) | ||
| popular_genre = max(genre_list, key = genre_list.count) |
There was a problem hiding this comment.
How would you solve this without the max function?
Comment on lines
+54
to
+67
| def get_unique_list_of_users_movies(user_data): | ||
| users_movies = [] | ||
| for movie in user_data["watched"]: | ||
| if movie not in users_movies: | ||
| users_movies.append(movie) | ||
| return users_movies | ||
|
|
||
| def get_unique_list_of_friends_movies(user_data): | ||
| friends_movies = [] | ||
| for friends_watched in user_data["friends"]: | ||
| for movies_watched in friends_watched["watched"]: | ||
| if movies_watched not in friends_movies: | ||
| friends_movies.append(movies_watched) | ||
| return friends_movies |
Comment on lines
+70
to
+71
| users_movies = get_unique_list_of_users_movies(user_data) | ||
| friends_movies = get_unique_list_of_friends_movies(user_data) |
Comment on lines
+84
to
+87
| for movies in friends_movies: | ||
| if movies not in users_movies: | ||
| friends_unique_list.append(movies) | ||
| return friends_unique_list |
There was a problem hiding this comment.
This section is doing the same work as lines 74-77. Could you create a helper function to do this work?
| for friends_watched in friend["watched"]: | ||
| if {"title":friends_watched["title"]} not in user_data["watched"]\ | ||
| and friends_watched["host"] in user_data["subscriptions"]: | ||
| if friends_watched not in reccomendations: |
There was a problem hiding this comment.
This conditional can be combined with and to the conditionals in the if statement above it.
Comment on lines
+102
to
+103
| frequent_genre = get_most_watched_genre(user_data) | ||
| user_not_watched = get_friends_unique_watched(user_data) |
Author
|
Thank you for this feedback @jbieniosek! Just the affirmation I needed. :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.