Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
3. Exercise 2

Instruction

Good job! How about this one?

Exercise

Load the spendings.xlsx file. There are two worksheets – one for January and one for February. Both have the same structure:

data spendings
01.01 3.00
02.01 15.00

Iterate over all monthly worksheets and get the sum of all the spendings columns. Assign the result to the total_spendings variable.

Stuck? Here's a hint!

Load the file with the load_workbook() function. To get the sheet names, use the sheetnames property. To get the indexes of the rows with the spendings, you can use range(2, ws.max_row + 1). Remember to get the cell values with the value property.