Optimize Functions In Python Practice