How can we reuse a loop nested inside a function for any range?

By using the function's parameter to help calculate a range's valueWe can't reuse a nested loop for different ranges

By using the function's parameter to help calculate a range's value.