Evaluate an expression binary tree - Daily Coding Challenge
dict > ifs
operator contains all the functions you need.
Taking total as an argument is unneeded.
I would personally split the 'Tree' which is actually a Node into two types, operators and values. But that may go against the challenge.
Use is to compare to None.


import operator

operators = {
    '*': operator.mul,
    '+': operator.add,
    '-': operator.sub,
    '/': operator.truediv,
}


class Tree:
    def __init__(self, value, left=None, right=None):
        """Initialise values"""
        self.value = value
        self.left = left
        self.right = right

    def determine(self):
        if self.left is None and self.right is None:
            return int(self.value)

        return operators[self.value](
            self.left.determine(),
            self.right.determine()
        )