Skip to content
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

Ocelots - Jennifer Dai #22

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Ocelots - Jennifer Dai #22

wants to merge 3 commits into from

Conversation

Jewelhae
Copy link

No description provided.

def create_movie(title, genre, rating):
pass
movie = {}
if title == None or genre == None or rating == None:

Choose a reason for hiding this comment

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

What would happen with an empty string as one of the parameters?

return user_data

def watch_movie(user_data,title):
for movie in user_data["watchlist"]:

Choose a reason for hiding this comment

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

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.


# -----------------------------------------
# ------------- WAVE 3 --------------------
# -----------------------------------------


#return list of movie that friends watched
def friends_watched_movie(user_data):

Choose a reason for hiding this comment

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

Could sets have been useful as an alternative to the nested loops?

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