"You are free to solve the above problem with your logic and provide the solution in the comment section below.\n", ...
Reusing a name in and out of a function is referred to as "name shadowing." Python happens to have already something named 'range' https://docs.python.org/3/library ...