ppcm python

Solutions on MaxInterview for ppcm python by the best coders in the world

showing results for - "ppcm python"
Cat
23 Feb 2018
1#!/usr/bin/python
2# -*- coding: utf-8 -*-
3 
4def ppcm(a,b):
5    """ppcm(a,b): calcul du 'Plus Petit Commun Multiple' entre 2 nombres entiers a et b"""
6    if (a==0) or (b==0):
7        return 0
8    else:
9        return (a*b)//pgcd(a,b)
10 
11# exemple d'utilisation:
12print ppcm(56,42) # => affiche 168
queries leading to this page
python ppcmppcm python