Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- #
- import time
- time.sleep(3) # detiene la ejecución del programa 10 segundos
- print(time.asctime()) # imprime fecha y hora
- # simular un contador regresivo y la explosión de una bomba
- tiempo = int(input("Ingrese el tiempo hasta el estallido de la bomba: "))
- for t in range(tiempo,0,-1):
- print(t)
- time.sleep(1)
- print("BOOM")
- # simular la tirada de un dado n veces
- import random
- total = int(input("Ingrese la cantidad de veces que desea arrojar el dado: "))
- for n in range(total):
- print(f"{n+1}º tirada: {random.randint(1,6)}")
- time.sleep(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement