python alg practices