Skip to content

Instantly share code, notes, and snippets.

@lablnet
Created August 24, 2020 10:58
Show Gist options
  • Select an option

  • Save lablnet/a9b09a304de684b2c455cd9d293f319a to your computer and use it in GitHub Desktop.

Select an option

Save lablnet/a9b09a304de684b2c455cd9d293f319a to your computer and use it in GitHub Desktop.
Pythonic way to find GCD.
def gcd(a, b):
return a if b == 0 else gcd(b, a % b)
print(gcd(int(input("Enter value of a: ")), int(input("Enter value of b: "))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment