Tree Implementation Using Python