Created
May 18, 2020 15:47
-
-
Save Satjpatel/125cde543af6c15d51b394d587211d22 to your computer and use it in GitHub Desktop.
Basic Python Code for GCD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def gcd(m,n): | |
cf = [] | |
for i in range(1,min(m,n)): | |
if (m%i)==0 and (n%i)==0 : | |
cf.append(i) | |
return cf[-1] | |
x = gcd(45,135) | |
print(x) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment