Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.78 KB | None | 0 0
  1. import math
  2. salida = True
  3. while salida:
  4.     repeticion = True
  5.     while repeticion:
  6.         tecladoPersona = input("por favor ingresa A y B: ")
  7.         numeroA = int(tecladoPersona.split(" ",2)[0])
  8.         numeroB = int(tecladoPersona.split(" ",2)[1])
  9.         if numeroA==0 and numeroB==0:
  10.             salida = False
  11.             break
  12.         if numeroA<0 or numeroA>10000:
  13.             print("numero A fuera del rango permitido")
  14.         if  numeroB<1 or numeroB>10000:
  15.             print("numero B fuera del rango permitido")
  16.         else:
  17.             repeticion = False
  18.             if numeroA>=0 and numeroB>=1 and numeroA<10000 and numeroB<10000:
  19.                 print("Maximo comun divisor de "+str(numeroA)+"! y ", numeroB,": ", math.gcd(math.factorial(numeroA), numeroB))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement