Advertisement
jtentor

MCD En Python

Aug 23rd, 2016
164
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # MCD En Python
  2. def mcd(a, b):
  3.     if a <= 0 or b <= 0:
  4.         raise ValueError("Error de argumento en MCD")
  5.     resto = a % b
  6.     while resto != 0:
  7.         a = b
  8.         b = resto
  9.         resto = a % b
  10.     return b
Advertisement
RAW Paste Data Copied
Advertisement