Posts by Henrique Amaral • 31 points
2 posts
-
2
votes4
answers6745
viewsA: How to implement a recursive MDC calculation algorithm in Python?
I built this code for this situation, it is possible to pass a list of numbers to facilitate when actually using the function. def __mdc_(x,y): while(y): x,y=y,x%y return x def mdc(nums): if…
-
1
votes5
answers9375
viewsA: Program to find MMC in Python
I saw this question and did this function, the advantage is that it receives a list of numbers, and the MMC can be calculated beyond 2 numbers. def mmc(nums): max_ = max(nums) i = 1 while True: mult…