pgcd.py

Created by stimorol

Created on March 06, 2023

289 Bytes

Calcul avec rédaction du pgcd de deux nombres a et b a entrer dans la fonction pgcd(a,b).


from math import *
# MADE BY ARMAND JAMET :D
def pgcd(a,b):
  print('PGCD('+str(a)+', '+str(b)+')',end='')
  spaces=(8+len(str(a))+len(str(b)))*' '
  while b!=0:
    b1=a%b
    print('=PGCD('+str(a)+', '+str(b)+')',end='\n'+spaces)
    a,b=b,b1
  print(a,'\n<3')

pgcd(324,111)

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.