Advertisement
jtentor

MCD En Python

Aug 23rd, 2016
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.22 KB | None | 0 0
  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
Add Comment
Please, Sign In to add comment
Advertisement