In the first class total
is a function as well as an attribute of the class. That is not okay :) Python thinks that the total you are referring to in the final line is the integer variable total and not the function.
It is considered a good practice to name the function total
as get_total
instead