Problem
Hi, I am have a problem. Well, I know that I can't use break
outside the loop but I use it in loop and still get an error.
What I do
I create a function that have a command break
and use it in loop. I get an error. I can't do something like this:
function()
break()
because my function have an if
statment, for example:
do somthing
if that:
break
Code
def destroy():
i = o.index(rect)
MAPh[i] -= 1
if MAPh[i] <= 0:
del o[i]
del MAP[i]
del MAPxy[i]
del MAPh[i]
break
for a in range(len(MAP)):
...
destroy