Python While Loop, the and (&) operator is not working
I am trying to find the greatest common factor. I wrote a bad (operation intensive) algorithm that decrements the lower value by one, checks using % to see if it evenly divides both the numerator and denominator, if it does then it exits the program. However, my while loop is not using the and operator, and thus once the numerator is divisible it stops, even though its not the correct answer. The numbers I am using are 54 and 42, the correct GCD (greatest common denominator) is 6. #heres a simple algorithm to find the greatest common denominator: iterations = 0; #used to calculate number of