Skip to content

Ocelot - Cindy T#14

Open
ciindii wants to merge 7 commits into
ada-ac2:masterfrom
ciindii:master
Open

Ocelot - Cindy T#14
ciindii wants to merge 7 commits into
ada-ac2:masterfrom
ciindii:master

Conversation

@ciindii

@ciindii ciindii commented Nov 10, 2022

Copy link
Copy Markdown

No description provided.

Comment thread viewing_party/party.py
def create_movie(title, genre, rating):
pass
movie = {}
if title and genre and rating:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good use of "truthiness" to catch both "" and None in your validation tests :)

Comment thread viewing_party/party.py
add_to_watched(user_data, movie)
print(movie)
i = 0
while i < len(user_data["watchlist"]):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm actually not quite sure that I am following how this is working :) It's a clever set up, but.. Note, while this may work here(?), it's considered dangerous practice to modify the content of a data structure that you're looping over. Especially in more complex code, this can open you up to complex errors. A simple alternative here could be to save a copy of what you get from movie in user_data["watchlist"] and iterate over that, so that as you modify user_data["watchlist"], there's no risk.

Comment thread viewing_party/party.py
genre_dict[genre] += 1
for k, v in genre_dict.items():
if v > high_genre:
high_genre = v

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These variables names were a little confusing, as I read them myself, because they look similar. Could something like "highest_valued_genre", "highest_valued_genre_name" be more clear?

Comment thread viewing_party/party.py
return None
else:
#loop through genre in user_data
for movie in user_data["watched"]:

@ilana-adadev ilana-adadev Dec 1, 2022

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice use of a dict in your data processing implementation here

Comment thread viewing_party/party.py
user_movies = []
friend_movies = []

for friend in user_data["friends"]:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could sets be helpful as a way to simplify some of this code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants