Collect song titles until the user is finished, then print the whole playlist back with a track number next to each one.
The Raffle challenge pulled one item out of a list. This one displays all of them — and that turns out to be where the interesting problem is.
len() to countdone.done must not end up on the playlist.Look carefully at the sample output. The first song is labeled 1, but in the list it lives at index 0. Track numbers and indexes are not the same thing, and it is your job to line them up.
Get this wrong in the obvious way and your playlist starts at track 0 — which no music player on earth does.
len() to find it rather than counting by hand.done immediately, say so instead of printing an empty header.Add a song (or type 'done'): Bohemian Rhapsody [Enter]Add a song (or type 'done'): Mr. Brightside [Enter]Add a song (or type 'done'): Take On Me [Enter]Add a song (or type 'done'): done [Enter]
--- Your Playlist ---1. Bohemian Rhapsody2. Mr. Brightside3. Take On Me
3 songs on this playlist.