Update linear-regression-function.py

made idiomatic, removed unused code