Simple greatest common factor script

Patrick Sabin patrick.just4fun at gmail.com
Sun Nov 29 06:18:51 EST 2009


> I don't see how this script is able to divide by zero. If a and b
> switch places everything works ok.

Have a look at your if-statements. It is possible, that both your if's 
are executed in one loop iteration (you can check this using pdb). You 
may want to try elif instead.

- Patrick



More information about the Python-list mailing list