Advertisement
Guest User

Ejercicio 16

a guest
Mar 22nd, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.64 KB | None | 0 0
  1. # Pedir la hora, minutos y segundos y mostrar la hora del segundo siguiente
  2. # 6:59:59 - 7:00:00
  3.  
  4. hora = int(input('Escribe la hora: '))
  5. minuto = int(input('Escribe los minutos: '))
  6. segundo = int(input('Escribe los segundos: '))
  7.  
  8. h = 0
  9. m = 0
  10. s = 0
  11.  
  12. if hora < 24 and minuto < 59 and segundo < 59:
  13.     print('La hora siguente es: ' + str(hora) + ':' + str(minuto) + ':' + str(segundo + 1))
  14. elif hora < 24 and minuto < 59:
  15.     print('La hora siguente es: ' + str(hora) + ':' + str(minuto + 1) + ':00')
  16. else:
  17.     print('La hora siguente es: ' + str(hora) + ':' + str(minuto) + ':' + str(segundo))
  18. if minuto < 60:
  19.     m += 1
  20. else:
  21.     m = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement