Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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
Source by python.jpvweb.com #
 
PREVIOUS NEXT
Tagged: #ppcm #python
ADD COMMENT
Topic
Name
7+5 =