'Looking a pythonic way to add many formulas that change coordinates in a spreadsheet

I am creating a spreadsheet with python

I want to add the following formula in the cells from D6 to P6. For example for D6, the formula should be

=AVERAGE(D3:D5)

and for E6 the formula should be

=AVERAGE(E3:E5)

I could do this for each one

sheet["D6"] = "=AVERAGE(D3:D5)"

But I am not clever enough to find out a way to do it this in a more pythonic way.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source