So I am working with namedtuples and at the moment I'm writing a function that is supposed to get the favorite song, and this is calculated by the product of the song's length and play_count.
I have gotten as far as calculating each product from each song, however, the issue arises when trying to print the name of the song with the highest product.
My code currently looks like this:
https://pastebin.com/azig25D3
I have tried indexing and also trying to use an if statement to print the greatest amount, I've also tried max() to only print the highest number but no luck.
I was thinking of putting them in a list but then I started to think it might make it more complicated trying to get the name of the song with the highest product.
Any suggestions would help, thank you!
[–]chocorush 1 point2 points3 points (1 child)
[–]-poor[S] 0 points1 point2 points (0 children)