How To Implement Tree In Python