Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- #
- # hacer un script que simule un contador en forma regresiva empezando
- # desde un valor ingresado por consola
- # ej:
- # >>> Ingrese un número entero mayor a cero: 5
- # >>> 5
- # >>> 4
- # >>> 3
- # >>> 2
- # >>> 1
- # >>> ¡BOOOMMM!
- # AYUDA: biblioteca time, función sleep ---> time.sleep
- import time # biblioteca para hacer el contador
- tiempo = int(input("Ingrese un número entero mayor a cero: "))
- for i in range(tiempo,0,-1):
- time.sleep(1)
- print(i)
- print("¡BOOOMMM!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement