The music platform GreatNoise.com wants to improve the service it offers to their subscribers. To do this, it will add different functionalities that users will be able to use in their playlists.
A playlist consists of a list of one or more songs, which are both lists with the following elements:
The three statements below are related but can be solved independently, without depending any of them on the solution of the others.
Use the letters ’a’, ’b’, and ’c’ as dictionary keys.
Scoring
Apartado 1: 33 puntos.
Apartado 2: 33 puntos.
Apartado 3: 34 puntos.
>>> lista = [["Higher", "Creed", "Greatest Hits", 316], ... ["Basket Case", "Green Day", "Dookie", 182], ... ["Glycerine", "Bush", "Sixteen Stone", 266], ... ["Congregation", "Foo Fighters", "Sonic Highways", 312], ... ["Blackbird", "Alter Bridge", "Blackbird", 478], ... ["Basket Case", "Green Day", "God's FB", 182], ... ["Fuck You", "Bad Religion", "True North", 134], ... ["Higher", "Creed", "Human Clay", 316]] >>> calcula_duracion(lista) (36, 26) >>> clasificacion = clasificar_duracion(lista) >>> clasificacion == {'a': 1, 'b': 3, 'c': 4} True >>> lista = [["Higher", "Creed", "Greatest Hits", 316], ... ["Basket Case", "Green Day", "Dookie", 182], ... ["Glycerine", "Bush", "Sixteen Stone", 266], ... ["Congregation", "Foo Fighters", "Sonic Highways", 312], ... ["Blackbird", "Alter Bridge", "Blackbird", 478], ... ["Basket Case", "Green Day", "God's FB", 182], ... ["Fuck You", "Bad Religion", "True North", 134], ... ["Higher", "Creed", "Human Clay", 316]] >>> canciones = estadisticas(lista) >>> canciones == {'Higher': ['Creed', 'Greatest Hits', 'Human Clay'], ... 'Basket Case': ['Green Day', 'Dookie', "God's FB"], ... 'Glycerine': ['Bush', 'Sixteen Stone'], ... 'Congregation': ['Foo Fighters', 'Sonic Highways'], ... 'Blackbird': ['Alter Bridge', 'Blackbird'], ... 'Fuck You': ['Bad Religion', 'True North']} True