Question: Python Your younger sibling has just discovered music from the 1970 's. They have put together a playlist of the same 5 songs repeated again
Python

Your younger sibling has just discovered music from the 1970 's. They have put together a playlist of the same 5 songs repeated again and again. Here are the songs: - ABC by The Jackson 5 - Venus by Shocking Blue - Lola by the Kinks - Let It Be by the Beatles - Cecilia by Simon and Garfunkel Here is an example of their playlist: ['Lola', 'Venus', 'Lola', 'Lola', 'Let It Be', 'Lola', 'ABC', 'Cecilia', 'Lola', 'Lola'] You want to make sure that Lola only gets played 3 times, so you want to complete this function that edits the playlist: def cap_song_repetition(playlist: List[str], song: str) sone: "" "Make sure there are no more than 3 occurrences of song in playlist. Select the loop(s) that accomplish this. while playlist. count(song) > 3 : playlist. remove(song) while playlist. count(song) > 3 : playlist. remove(playlist.index(song)) while playlist. count(song) >=3 : playlist. remove(song) while playlist. count(song) > 3 : playlist.pop(song) while playlist. count(song) > 3: playlist.pop(playlist.index(song))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
