actually. The very next loop, looks at anyuthing in DELETED_COOKBOOK_LIST and removes it from ADDED_COOKBOOK_LIST... since you now have a loop that's building DELETED_COOKBOOK_LIST, why not just merge them?

(You're getting more comments now because I'm testing your code and merging it with my own internally)