TypeError: unsupported operand type(s) for +: 'YearEndChartEntry' and 'int'

Viewed 27

I know why I have this error but I do not understand it very well therefore I am not able to solve it. Could someone please explain it to me further. The function of this code block is to gather the top 7 artists on the Billboard charts without repetition.

  artists = []
year = 2020
while year > 2006:
    TAChart = billboard.ChartData('Top-Artists', year=year)
    count = 0
    for count in TAChart:
        count = count + 1
        if count.artist not in artists:
                artists.append(count.artist)
        if count == 6:
            break
    
    year = year - 1

len(artists)
0 Answers
Related