Sample Skeleton Explanation:
# remove_song(library, song_title) -> bool
# Step 1: Validate Inputs
# - If song_title is empty, raise ValueError
# - If library is None or not a list, maybe raise ValueError
#
# Step 2: Loop through each song in library
# - Check if the current song's title == song_title
# - If found, remove that song from library, return True
#
# Step 3: If loop ends with no match, return False
Relating to earlier sections:
-
Data Definition (Ch.1): We ensure each item is a Song and song_title is valid (non-empty).
-
Signature & Purpose (Ch.2): We plan to return bool and possibly raise ValueError if song_title is empty.
-
Examples & Tests (Ch.3): We note the scenario for "removing an existing song" (expect True), "song not found" (False), and "song_title is empty" (ValueError).
By drafting this outline first, we avoid mixing logic and validation, ensuring each piece is consistent with prior deliverables.