escape from loop of if

is there a command that escape from a loop of even an if function?

Thanks

Not quite sure what you mean, but in general: yes there are many ways to escape from a loop in python: http://docs.python.org/tutorial/controlflow.html#break-and-continue-statements-and-else-clauses-on-loops

if inside a for loop and i have and if statement
can i break inside the if and this would end the for loop ?

Thanks

Sure you can, example:

for i in xrange(10):
    if i > 5:
        break
    print i

More info is in the link varkenvarken provided.

for i in range(1,rings+1):

           an1=dtr*i      # angle in radians
            if an1 < amax:
                    break

the if looks a lot like yours but
it did not like thus one at all?

what wrong with thieses lines

Thanks

Can you please put your code in code tags? It’s impossible to see the indentation this way. You find code tags when you hit “Go Advanced”, it’s the hash mark #.

About your code, what is rings, an1, dtr and amax? What is the problem? Is there an error message?