Currently I have this function:
x = 0
limit = 10
y = 7
def basic(x):
global y
while x <= limit:
if x == 0 or 1:
y += 1
basic(x+1)
return x
else:
y += 2
basic(x+1)
return x
basic(x)
print(y)
When I print y it returns 18 which means that it is stuck in the if statement and would not go to the else statement but x does stop at the limit hence y = 18. I looked up various sources online but I cannot get an exact clear visualization of my problem.