[Tutor] nested loops

Robert Berman bermanrl at cfl.rr.com
Mon Feb 7 16:55:33 CET 2011


On 02/07/2011 10:33 AM, Ashley F wrote:
> I am trying to write a function...(it's kind of like a long way to do 
> BLAST but only comparing 2 sequences)
> I have 3 loops nested...Within those loops, I obtain a "best fit 
> score" so to speak.
> I can get the program to run...but the loops run all the way to the 
> end.  I can't figure out how to print the best score found...and the 
> alignment that went with it. (therefore, my results will only be 
> correct if my last alignment is the highest scoring one--which it 
> usually isn't)
> To try to clear this up...
> The part of my pseudocode that I'm having trouble putting into actual 
> code in python is:
> "if that alignment has the best score seen so far
>      save the score and that alignment"
>
>
It would be much easier for people to help you if you would include the 
actual code you have written.
We have no way to tell you are running to the end or not; we certainly 
have nothing showing 'a best fit' algorithm. If we can see the actual 
code we can at least show you where you might want to look for current 
and/or potential problems.

Also, what OS are you using?
What version of Python are you using?

Robert Berman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110207/9b366211/attachment.html>


More information about the Tutor mailing list