How to find out the Greatest Common Divisor(GCD) using python?
Algorithm for GCD:
1: Initialize the two integers A and B and make sure they are positive.
2: Take max of those and store them in a separate variable.
3: Now initialize an empty list.
4: Now run a for loop and append all the values which are dividing both A and B.
5: Now print the max value of the list. Which is our GCD.
CODE:
Thank you !!