The return statement stops the function execution at the first iteration, returning a single value, the computed value for the first item of the input list.
What you are looking for is either a generator, which will return a new value, each time you call the function, or a list comprehension, which will return a new list with the computed values.
You may also use numpy arrays directly as you seem to have it as a dependency (thanks @GIRISH kuniyal for the idea).
import numpy as np
# Generator
def limit_generator(x_es):
for x in x_es:
yield np.sqrt((3-5*x+x**2+x**3))/(x-1)
# List comprehension
def limits(x_es):
return [np.sqrt((3-5*x+x**2+x**3))/(x-1) for x in x_es]
# Numpy arrays
def numpy_limits(x_es):
x = np.array(x_es)
return np.sqrt((3-5*x+x**2+x**3))/(x-1)
if __name__ == '__main__':
numbers = [1.1, 1.01, 1.001]
generator = limit_generator(numbers)
print(next(generator), next(generator), next(generator))
print(limits(numbers))
print(numpy_limits(numbers))
2.0248456731316713 2.00249843945087 2.000249984482112
[2.0248456731316713, 2.00249843945087, 2.000249984482112]
[2.02484567 2.00249844 2.00024998]