-
-
Save parzibyte/9ece1063aec59414eea50c42b99cdcc9 to your computer and use it in GitHub Desktop.
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
""" | |
https://parzibyte.me/blog | |
""" | |
# Necesitamos la función del MCD, puedes ver más en: | |
# https://parzibyte.me/blog/2021/03/30/python-maximo-comun-divisor/ | |
def maximo_comun_divisor(a, b): | |
temporal = 0 | |
while b != 0: | |
temporal = b | |
b = a % b | |
a = temporal | |
return a | |
def minimo_comun_multiplo(a, b): | |
return (a * b) / maximo_comun_divisor(a, b) | |
a = 20 | |
b = 6 | |
mcm = minimo_comun_multiplo(a, b) | |
print(f"El mínimo común múltiplo de {a} y {b} es {mcm}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment