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

C22 Sunitha Nela and Izzy Hirad #15

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Prev Previous commit
change watch movie to copy
izzycommits committed Sep 27, 2024
commit 9305c631c0391cb2bd50dc26b00ffef5a968d66c
23 changes: 16 additions & 7 deletions viewing_party/party.py
Original file line number Diff line number Diff line change
@@ -24,18 +24,27 @@ def add_to_watchlist(user_data, movie):


def watch_movie(user_data, title):
new_watchlist = []
new_watched = []

watch_list = user_data["watchlist"]
watched = user_data["watched"]
for movie in user_data["watchlist"]:
new_watchlist.append(movie)

for movie in user_data["watched"]:
new_watched.append(movie)

for movie in watch_list:
for movie in new_watchlist:
if movie["title"] == title:
watched.append(movie)
watch_list.remove(movie)
new_watched.append(movie)
new_watchlist.remove(movie)
break
return user_data


updated_user_data = {
"watchlist": new_watchlist,
"watched": new_watched
}

return updated_user_data

# -----------------------------------------
# ------------- WAVE 2 --------------------