Best Fit Algorithm In Python Step