Optimize Functions In Python For Beginners