<div class="gmail_extra"><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">
<br>
<br>
</div></div>So did you read the following paragraphs?  You should not be using "and"<br>
in that expression. </blockquote><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span style="background-color:rgb(255,242,204)">Yes i tried "or" also but no use ..</span>...<br>

<div class="im"><br>
>><br>
>> You do not want "and" in that expression.  The way you've coded it,<br>
>> it'll only skip items in which both indices are out of range.  Change it to<br>
>>                   if idx[0] >= data.width or idx[1] >= data.height:<br>
>><br>
>> and depending on your answer to my earlier query, you may want to also<br>
>> check if either subscript is negative.<br>
>><br>
>>>                             continue<br>
>>>                         else :<br>
>>>                             point = data[idx[0], idx[1]]<br>
>>>                             if point == (0.0, 0.0, 0.0 ):<br>
>>>                                 print point<br>
>>>                                 continue<br>
>>>                             else:<br>
>>>                                 dist = distance(centre, point)<br>
>>>                                 print dist<br>
>>>                                 if  dist < radius :               and<br>
>> rings<br>
>>> should be added only when this condition is satisfied<br>
>>>                                     print point<br>
>>>                                     points.append(point)<br>
>>>                                     change = True<br>
>>>                                     print change<br>
>>><br>
>>><br>
>>>                         break<br>
>><br>
>> Why do you want to terminate the loop after only iteration?<br>
>><br>
><br>
> I dint get your question ??<br>
><br>
<br>
</div>You have a break there.  What's it for?  It'll make sure you only<br>
process one of the idx values from new_indices.  i doubt that's what you<br>
intended.<span class="HOEnZb"><font color="#888888"><br>
</font></span></blockquote><span style="background-color:rgb(234,153,153)"><span style="background-color:rgb(252,229,205)">The idea here is if no more point is added to the list of po<span style></span>ints i.e. all points surrounding the centre is zero.. I want to break the loop and go to the next point..</span><br>
</span></div><br></div>