I am building a music store example in python. I am trying to find a way of displaying the total of all of the sales of all of the music.
Everything is stored in objects in a list trackList. Track is the object so track.sales returns the sales of particular track.
This is what I have so far:
I'm really struggling so any help would be great.
Everything is stored in objects in a list trackList. Track is the object so track.sales returns the sales of particular track.
This is what I have so far:
Code:
def totalSales(trackList):
for track in trackList:
total = sum(track.sales)
print total
Comment