Python Basics IteratingLists

Hii @All,

Can someone please help in understanding below given logic assigned to the variable “b”

a=[3,1,4,2]
b=[sum(a[0:x+2]) for x in range(0,len(a))]
print(b)

Thank you!