Hello community, I have a problem that I still can’t find a way to solve, I have 4 lists as information [[IN], [OUT], [SECTION], [PARTIAL]], and I need to perform the following calculations, in ADDITIONAL I must add them all the sections that in their accumulated are connected to the main section, and in ACCUMULATED add PARTIAL plus ADDITIONAL if any and the previous ACCUMULATED.

```
IN OUT SECTION PARTIAL ADDITIONAL ACCUMULATED
A1 A2 A1-A2 1 0 1
A2 A3 A2-A3 0.5 0 1.5
A3 A4 A3-A4 0 7.5 9
A4 A5 A4-A5 2 0 11
A5 A6 A5-A6 1 1 13
A3.1 A3.2 A3.1-A3.2 1 0 1
A3.2 A3.3 A3.2-A3.3 3 3 7
A3.3 A3 A3.3-A3 0 0 7
A3.1' A3 A3.1'-A3 0.5 0 0.5
A5.1 A5 A5.1-A5 1 0 1
A3.2.1 A3 A3.2.1-A3 3 0 3
```

How would you solve this in Python?

Attached is an image of a table with a simple exercise, I hope you understand it. In any case, I will also place another image that describes it graphically.