Skip to content
Advertisement

How to calculate total column using python

I am creating an inventory system in Python. Treeview table total column need to calculate and display sum using python. I need to calculate final total of total column. I tried but I could the result what I tried so far I attached below. I got an error

sum1 += tot TypeError: unsupported operand type(s) for +=: ‘float’ and ‘tuple’

I need to calculate column tot values like 400 + 5000 + 900 in above screenshot; I shown I have to print the final total

JavaScript

Advertisement

Answer

Does something like this work? Change the last for loop in show() to this:

JavaScript

Hope it solved your doubts, if any errors do let me know

Cheers

Advertisement