Advertisement
teslariu

ejs. de bibliotec std

Dec 3rd, 2022
643
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.62 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. #
  4. import time
  5.  
  6. time.sleep(3)    # detiene la ejecución del programa 10 segundos
  7. print(time.asctime())    # imprime fecha y hora
  8.  
  9. # simular un contador regresivo y la explosión de una bomba
  10. tiempo = int(input("Ingrese el tiempo hasta el estallido de la bomba: "))
  11.  
  12. for t in range(tiempo,0,-1):
  13.     print(t)
  14.     time.sleep(1)
  15. print("BOOM")
  16.  
  17. # simular la tirada de un dado n veces
  18. import random
  19.  
  20. total = int(input("Ingrese la cantidad de veces que desea arrojar el dado: "))
  21.  
  22. for n in range(total):
  23.     print(f"{n+1}º tirada: {random.randint(1,6)}")
  24.     time.sleep(1)
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement