-
Notifications
You must be signed in to change notification settings - Fork 72
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
rock_lin #64
base: master
Are you sure you want to change the base?
rock_lin #64
Conversation
deleted extra accidental function in Wave 5
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 Lin! Your code was neat and easy to read. Overall, you hit the learning goals. I'm glad you were able to use newer data structures and functions on this project! I have added some comments and am looking forward to going over them with you in our next 1:1 (:
Keep up the good work!
{ | ||
"python.pythonPath": "venv/bin/python" | ||
} |
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.
For future reference, we'll be adding all files specific to your coding environment to a .gitignore file. This will prevent any conflicts your code may have with another teammates' coding environment.
movies_dict["title"] = title | ||
movies_dict["genre"] = genre | ||
movies_dict["rating"] = rating |
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! Another way to write this code is to create the dictionary in the if statement so
if title and genre and rating:
movies_dict = {
"title": title,
"genre": genre,
"rating": rating
}
return movies_dict
for movie in user_data["watchlist"]: | ||
if title in movie["title"]: | ||
user_data["watchlist"].remove(movie) | ||
user_data["watched"].append(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.
You could also call the add_to_watched
function here
else: | ||
for movies in user_data["watched"]: | ||
genres_from_user.append(movies["genre"]) | ||
most_popular_genre = max( |
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 max and set here. Please add a comment next time you use code that's outside of the scope of the curriculum.
def remove_dupes(user_data): | ||
return [i for n, i in enumerate( | ||
user_data) if i not in user_data[n + 1:]] |
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.
Ooo great use of list comprehension and the enumerate function!
No description provided.