Single Linear Regression Python Code With If Else Statement