Answers for "ppcm python"

0

ppcm python

#!/usr/bin/python
# -*- coding: utf-8 -*-
 
def ppcm(a,b):
    """ppcm(a,b): calcul du 'Plus Petit Commun Multiple' entre 2 nombres entiers a et b"""
    if (a==0) or (b==0):
        return 0
    else:
        return (a*b)//pgcd(a,b)
 
# exemple d'utilisation:
print ppcm(56,42) # => affiche 168
Posted by: Guest on April-14-2021

Python Answers by Framework

Browse Popular Code Answers by Language