Sum the second value of each tuple in a list

sum(n for _, n in structure)

would work.


sum(x[1] for x in structure)

should work


You could do

sum(zip(*structure)[1])

Using a functional style, you could do

reduce(lambda x,y:x+y[1], structure,0)