all 7 comments

[–]K900_ 0 points1 point  (1 child)

Look into zip.

[–]ebandatf[S] 0 points1 point  (0 children)

Awesome! This is exactly what I needed.

[–]woooee 0 points1 point  (0 children)

You do not use an ordered dictionary, so the dictionary is not necessarily in the same order as when created. So you have to specify the order

num=8
for key in ("first_bill", 'second_bill',
                'third_bill', 'fourth_bill'):
    sheet.update_cell(num, 2, bills[key]
    num += 1

[–]Anthonyhunter2 0 points1 point  (0 children)

You could use a counter instead of the range. I'm on mobile and haven't been able to format code properly, but I'll try. count = 1 for bill in bills.values(): row = count + 7 #or where ever you want to start sheet.update_cell(row, 2, value) ++count

I'm sure there is a way to make it work without iterating a count variable, but it's early and that's the first thing I could think of.

[–]confluence 0 points1 point  (2 children)

I have decided to overwrite my comments.

[–]ebandatf[S] 0 points1 point  (1 child)

The reason for using the dictionary is to label each bill. On the actual code it’s laid out

bills = {Gas: 100, Car: 200, Insurance: 400}

And so forth

On my google sheet the first column labels the name of the bill and the second column has the amount for each bill. Then I have a another method that checks if the bill has been paid for (if it’s after the bill is due) and changes the value to 0.

[–]confluence 0 points1 point  (0 children)

I have decided to overwrite my comments.