Advertisement
fenix15100

EX7_AF3_PT4

Oct 16th, 2014
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.82 KB | None | 0 0
  1. #Programa Fran Camacho:
  2. #EX7
  3.  
  4. while True:
  5.     try:
  6.        
  7.         num1=abs(int(input("Dime un numero entero positivo ")))
  8.         num2=abs(int(input("Dime OTRO numero entero positivo ")))
  9.  
  10.         if num1==num2:
  11.             print("Los dos numeros son iguales")
  12.  
  13.         elif (num1>num2)and (num1%num2==0):
  14.             print("El primer numero es el mayor i es multiplo del segundo")
  15.         elif (num1>num2)and (num1%num2!=0):
  16.             print ("El primer numero es el mayor i NO es multiplo del segundo")
  17.         elif (num2>num1) and (num2%num1==0):
  18.             print("El segundo numero es el mayor i es multiple del primero")
  19.         else:
  20.             print("El segundo numero es el mayor i no es multiple del primero")
  21.             break
  22.     except ValueError:
  23.                 print("No has introducido numeros")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement