escape from loop of if

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


Not quite sure what you mean, but in general: yes there are many ways to escape from a loop in python:

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


Sure you can, example:

for i in xrange(10):
    if i > 5:
    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:

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

what wrong with thieses lines


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?