Advertisement
Guest User

Formica_ej17

a guest
Apr 1st, 2020
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.38 KB | None | 0 0
  1. print('ingrese numero de dia')
  2. dia=int(input())
  3. semana1=["LUNES","MARTES","MIERCOLES","JUEVES","VIERNES","SABADO","DOMINGO"]
  4. print('ingrese numero de mes')
  5. mes=int(input())
  6. meses=["ENERO","FEBRERO","MARZO","ABRIL","MAYO","JUNIO","JULIO","AGOSTO","SEPTIEMBRE","OCTUBRE","NOVIEMBRE","DICIEMBRE"]
  7. print('ingrese Año')
  8. año=int(input())
  9. if (0<=dia<=6 and 0<=mes<=11 and 1900<=año<=2050):
  10.     print("El dia siguiente es",semana1[dia+1],dia+1,meses[mes-1],"del año",año)
  11. elif  (7<=dia<=13 and 0<=mes<=11 and 1900<=año<=2050):
  12.     print("El dia siguiente es", semana1[dia-7],dia+1,meses[mes-1],"del año",año)
  13. elif  (14<=dia<=20 and 0<=mes<=11 and 1900<=año<=2050):
  14.     print("El dia siguiente es",semana1[dia-14],dia+1,meses[mes-1],"del año",año)
  15. elif  (21<=dia<=27 and 0<=mes<=11 and 1900<=año<=2050):
  16.     print("El dia siguiente es", semana1[dia-21],dia+1 ,meses[mes-1],"del año",año)
  17.  
  18. elif (28<=dia<=31 and mes==2):
  19.     print('Febrero no tiene mas de 28 dias y el dia siguiente es 1 de Marzo')
  20.  
  21. elif (28<=dia<=30 and mes==4 or mes==6 or mes==9 or mes==11):
  22.     print("El dia siguiente es", semana1[dia-27],"1 de",meses[mes],"del año",año)    
  23.  
  24. elif (31==dia and mes==1 or mes==3 or mes==5 or mes==7 or mes==8 or mes==10 or mes==12):
  25.     print("El dia siguiente es", semana1[dia-29],"1 de",meses[mes],"del año",año)
  26.  
  27. else:
  28.     print('Esta no es una fecha correcta')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement