I'm trying to get an average rating in my plugin and I keep getting a 'divide by zero' error when I do this:
Code:
top = int(sum(rateList))
bottom = int(len(rateList))
averageRating = top/bottom
However, if I change the "/" to any other mathematical symbol, it works as expected. Additionally, if I remove the variables and use plain int values, it works fine. Is this a bug, or am I doing something wrong?