Advertisement
saintsoul

Della_Rina_Ejercicio13

Apr 5th, 2020
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.78 KB | None | 0 0
  1. ################################################################
  2. ##EJE. 12: Pedir el día, mes y año de una fecha e indicar si####
  3. ##la fecha es correcta. Suponiendo todos los meses de 30 días.##
  4. ################################################################
  5.  
  6.  
  7. print('ingrese una fecha suponiendo que cada mes tiene 30 dias')
  8.  
  9.  
  10. #               #se establecen variarbles#
  11.  
  12. dia = int(input('ingrese el dia: '))
  13. mes = int(input('ingrese el mes: '))
  14. anio = int(input('ingrese el año: '))
  15. Rdia = 0
  16. Rmes = 0
  17. Ranio = 0
  18. #               #desarrollo#
  19.  
  20. if dia>0 and dia<31:
  21.     Rdia = 1
  22. if mes>0 and mes<13:
  23.     Rmes = 1
  24. if anio>0 and anio<2021:
  25.     Ranio = 1
  26. if Rdia == 1 and Rmes == 1 and Ranio == 1:
  27.     print('la fecha es correcta')
  28. else:
  29.     print('la fecha es incorrecta')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement