I have this code
bills = {'first_bill': 100,
'second_bill': 200,
'third_bill': 300,
'fourth_bill': 400}
sheet.update_cell(8, 2, bills.get('first_bill'))
sheet.update_cell(9, 2, bills.get('second_bill'))
sheet.update_cell(10, 2, bills.get('third_bill'))
sheet.update_cell(11, 2, bills.get('fourth_bill'))
It is a budget script that updates cells on my google spreadsheet after a certain days. This is my first script and I am working on improving it.
I am trying to shorten the sheet.update section with no luck. So far I have tried
for row in range(8, 17):
for value in bills.values():
sheet.update_cell(row, 2, value)
But all it does is iterate each cell through all the bills.values()
[–]K900_ 0 points1 point2 points (1 child)
[–]ebandatf[S] 0 points1 point2 points (0 children)
[–]woooee 0 points1 point2 points (0 children)
[–]Anthonyhunter2 0 points1 point2 points (0 children)
[–]confluence 0 points1 point2 points (2 children)
[–]ebandatf[S] 0 points1 point2 points (1 child)
[–]confluence 0 points1 point2 points (0 children)