Jessica E Ambriz-Madrigal - Lions #162
Jessica E Ambriz-Madrigal - Lions #162Jessicaenvisions wants to merge 4 commits intoAda-C18:masterfrom
Conversation
goeunpark
left a comment
There was a problem hiding this comment.
Great job, Jessica!
Your functions and conditionals look polished, your assert statements are clear, and nested loops iterate beautifully! I left a few suggestions inline. Remember that you can also write more than one commit message per wave! Based on our revised requirements, this project is a Green. 🟢
| assert updated_data["watched"][0]["title"] == MOVIE_TITLE_1 | ||
| assert updated_data["watched"][0]["genre"] == GENRE_1 | ||
| assert updated_data["watched"][0]["rating"] == RATING_1 |
| assert len(updated_data["watched"]) == 2 | ||
|
|
||
| raise Exception("Test needs to be completed.") | ||
| assert updated_data["watched"][1] == movie_to_watch |
| assert INTRIGUE_3 in friends_unique_movies | ||
| assert HORROR_1 in friends_unique_movies | ||
| assert FANTASY_4 in friends_unique_movies |
| # ------------- WAVE 1 -------------------- | ||
|
|
||
| from distutils.file_util import move_file | ||
| from pickle import FALSE |
There was a problem hiding this comment.
Remember to clear any import statements that we don't need before submission! 😉
| def create_movie(title, genre, rating): | ||
| pass | ||
| new_movie = {} | ||
| if title == None or genre == None or rating == None: |
There was a problem hiding this comment.
Great chained logic in this conditional!
| average_rating = all_ratings_added/len(user_data["watched"]) | ||
| return average_rating |
There was a problem hiding this comment.
Great job combining division with the length calculation!
| maximum_key = None | ||
| maximum_value = 0 |
There was a problem hiding this comment.
Hmm, could we have more descriptive variable names? Maybe best_genre_name and best_genre_count?
| # ----------------------------------------- | ||
|
|
||
|
|
||
| def get_unique_watched(user_data): |
There was a problem hiding this comment.
Small nit/preference: I like to initialize all my known variables right after defining the function so I can keep track of them easier! For example, I (personally, meaning you don't have to do this!) would put L88 and L93 right after each other around L88.
| for friend in user_data["friends"]: | ||
| for movie in friend["watched"]: | ||
| for host in movie["host"]: | ||
| if movie["title"] not in movie_list: | ||
| if movie not in friends_movies: | ||
| if host in movie_list: | ||
| friends_movies.append(movie) | ||
|
|
There was a problem hiding this comment.
👀 OOOO, interested in where you might be going here! Let me know if you want to walk through this Wave in our 1:1s!
| movie_list = [] | ||
| for movie in user_data["watched"]: | ||
| movie_list.append(movie["title"]) |
There was a problem hiding this comment.
We can get rid of this and refer to user_data["watched"] directly in L108.
Want to look over wave 4. Finished until wave 3.