Medium Decision Tree Python Implementation