Ivan other exercise
unknown
python
3 years ago
955 B
2
Indexable
ex3 = ''' 1.d) Andrea wants to create a playlist with some songs by The Black Keys. He wrote down on a paper the list of songs he would like to include. For each song first, he wrote the name of the album and then the title of the song contained in it. The two values are separated using "::". For instance, in el_camino::lonely_boy the album name is "el_camino" and "lonely_boy" is the title of the song. Here we have the entire playlist of Andrea, the songs are separated by ";;":''' playlist_txt = "el camino::lonely boy ;; el camino::little black submarine ;; el camino::gold on the ceiling ;; turn blue::fever ;; turn blue::gotta get away ;; brothers::howlin for you ;; brothers::tighten up ;; turn blue::it is up to you now" ''' Define the function build_playlist_dict() which takes playlist_txt as parameter and creates a dictionary having the album titles as keys each key will have the list of all its corresponding songs. '''
Editor is loading...