Guest User

Formica_ej19

a guest
Apr 4th, 2020
245
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. print('Ingrese dia inicial')
  2. dia1=int(input())
  3. print('Ingrese mes inicial')
  4. mes1=int(input())
  5. print('Ingrese año inicial')
  6. año1=int(input())
  7.  
  8. print('Ingrese dia final')
  9. dia2=int(input())
  10. print('Ingrese mes final')
  11. mes2=int(input())
  12. print('Ingrese año final')
  13. año2=int(input())
  14.  
  15.          
  16. restadia=dia1-dia2
  17. restames=mes1-mes2
  18. restaaño=año1-año2
  19. restadianeg=restadia*(-1)
  20. restamesneg=restames*(-1)
  21. restaañoneg=restaaño*(-1)
  22.  
  23.  
  24.    
  25. if(dia1<dia2 and mes1==mes2 and año1==año2) and (1<=dia1<=31 and 1<=dia2<=31 and 1<=mes1<=12 and 1<=mes2<=12):
  26.     print('la diferencia de dias es', restadia*(-1))
  27. elif (dia1==dia2) and (mes1==mes2) and (año1==año2) and (1<=dia1<=31 and 1<=dia2<=31 and 1<=mes1<=12 and 1<=mes2<=12):
  28.     print('Las fechas son iguales')
  29.  
  30. elif (dia1>dia2) and (mes1==mes2) and (año1==año2)and (1<=dia1<=31 and 1<=dia2<=31 and 1<=mes1<=12 and 1<=mes2<=12):
  31.     print('la diferencia de dias es', restadia)  
  32.  
  33.  
  34.  
  35. elif (dia1==dia2) and (mes1<mes2) and (año1==año2)and(1<=dia1<=31 and 1<=dia2<=31 and 1<=mes1<=12 and 1<=mes2<=12):
  36.     print('la diferencia de mes es', restames*(-1))
  37.  
  38. elif (dia1==dia2) and (mes1>mes2) and (año1==año2)and(1<=dia1<=31 and 1<=dia2<=31 and 1<=mes1<=12 and 1<=mes2<=12):
  39.     print('la diferencia de mes es', restames)    
  40.  
  41. elif (dia1==dia2) and (mes1==mes2) and (año1<año2)and(1<=dia1<=31 and 1<=dia2<=31 and 1<=mes1<=12 and 1<=mes2<=12):
  42.     print('la diferencia de año es', restaaño*(-1))
  43.  
  44. elif (dia1==dia2) and (mes1==mes2) and (año1>año2)and(1<=dia1<=31 and 1<=dia2<=31 and 1<=mes1<=12 and 1<=mes2<=12):
  45.     print('la diferencia de año es', restaaño)    
  46. elif (dia1>dia2) and (mes1<mes2) and (año1==año2)and (1<=dia1<=31 and 1<=dia2<=31 and 1<=mes1<=12 and 1<=mes2<=12):
  47.     print('la diferencia de dias es',restadia,',de mes es',restamesneg)
  48. elif (dia1<dia2) and (mes1>mes2) and (año1==año2)and (1<=dia1<=31 and 1<=dia2<=31 and 1<=mes1<=12 and 1<=mes2<=12):    
  49.     print('la diferencia de dias es',restadianeg,',de mes es',restames)
  50. elif (dia1<dia2) and (mes1<mes2) and (año1==año2) and (1<=dia1<=31 and 1<=dia2<=31 and 1<=mes1<=12 and 1<=mes2<=12):
  51.     print('la diferencia de dias es',restadianeg,',de mes es',restamesneg)
  52. elif (dia1>dia2) and (mes1>mes2) and (año1==año2)and (1<=dia1<=31 and 1<=dia2<=31 and 1<=mes1<=12 and 1<=mes2<=12):    
  53.     print('la diferencia de dias es',restadia,',de mes es',restames)
  54. elif (dia1<dia2) and (mes1<mes2) and (año1<año2) and (1<=dia1<=31 and 1<=dia2<=31 and 1<=mes1<=12 and 1<=mes2<=12):
  55.     print('la diferencia de dias es',restadianeg,',de mes es',restamesneg,',de año es',restaañoneg)
  56. elif (dia1>dia2) and (mes1>mes2) and (año1>año2)and (1<=dia1<=31 and 1<=dia2<=31 and 1<=mes1<=12 and 1<=mes2<=12):
  57.     print('la diferencia de dias es',restadia,',de mes es',restames,',de año es',restaaño)
  58. elif (dia1<dia2) and (mes1>mes2) and (año1<año2)and (1<=dia1<=31 and 1<=dia2<=31 and 1<=mes1<=12 and 1<=mes2<=12):
  59.     print('la diferencia de dias es',restadianeg,',de mes es',restames,',de año es',restaañoneg)    
  60. elif (dia1<dia2) and (mes1<mes2) and (año1>año2)and (1<=dia1<=31 and 1<=dia2<=31 and 1<=mes1<=12 and 1<=mes2<=12):
  61.     print('la diferencia de dias es',restadianeg,',de mes es',restamesneg,',de año es',restaaño)
  62. elif (dia1<dia2) and (mes1>mes2) and (año1>año2)and (1<=dia1<=31 and 1<=dia2<=31 and 1<=mes1<=12 and 1<=mes2<=12):
  63.     print('la diferencia de dias es',restadianeg,',de mes es',restames,',de año es',restaaño)    
  64. elif (dia1>dia2) and (mes1<mes2) and (año1<año2)and (1<=dia1<=31 and 1<=dia2<=31 and 1<=mes1<=12 and 1<=mes2<=12):
  65.     print('la diferencia de dias es',restadia,',de mes es',restamesneg,',de año es',restaañoneg)    
  66. elif (dia1>dia2 and mes1<mes2 and año1>año2) and (1<=dia1<=31 and 1<=dia2<=31 and 1<=mes1<=12 and 1<=mes2<=12):
  67.     print('la diferencia de dias es',restadia,',de mes es',restamesneg,',de año es',restaaño)    
  68. elif (dia1>dia2) and (mes1>mes2) and (año1<año2)and (1<=dia1<=31 and 1<=dia2<=31 and 1<=mes1<=12 and 1<=mes2<=12):    
  69.     print('la diferencia de dias es',restadia,',de mes es',restames,',de año es',restaañoneg)        
  70. else:
  71.     print ('las fechas son incorrectas')
RAW Paste Data