I have the following while loop:
while pointer < len(stack):
temp_string +=1
if stack[pointer] == "[":
break
pointer +=1
Now, I know that the break statement will cause the while loop
to terminate, but am I right to say that as long as there is a break
statement within the while loop
(in any scope), as soon as it is reached, we break out of the while loop? i.e:
while pointer < len(stack):
temp_string +=1
if stack[pointer] == "[":
if ....:
if ...:
break
pointer +=1
So for the above, once we hit the break, it will break out of the while loop? Is this correct? And does the same apply to while loops within while loops?