You’re building playlist features for a music app. You’re given the function print_playlist to display a playlist’s contents.
Your task is to write two functions:
reverse_playlist takes a playlist and returns a new playlist with the songs in reverse order. The original playlist must remain unchanged.remove_last_added takes a playlist and removes the most recently added song (to undo a song added by mistake). If the playlist is empty, it should do nothing.Given a playlist:
"Sound of Silence", "Blowin' in the Wind", "Drive"reverse_playlist should return a new playlist:"Drive", "Blowin' in the Wind", "Sound of Silence"remove_last_added on the original playlist should reduce it to:
"Sound of Silence", "Blowin' in the Wind"