I got an error at the while, that the name 'start' is not defined, although I declared it as global inside the nested one, I know that there is another approach is to changed the signature of the function of BS to take the start and end variables, but I need to know how to solve it using the global approach, Thanks!
class math:
def search(self,nums,x):
start = 0
end = len(nums)
def BS():
global start
global end
while(start<=end):
#i assign here a new value to start and end
first = BS()
return first