Advertisement
teslariu

ejercicios varios

Feb 11th, 2023
852
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.64 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. """
  4. Contador regresivo que simula una bomba
  5.  
  6.  
  7. import time
  8.  
  9. tiempo = int(input("Ingrese el tiempo: "))
  10.  
  11. for t in range(tiempo,0,-1):
  12.    print(t)
  13.    time.sleep(1)
  14.    
  15. print("BOOOMMM")
  16.  
  17.  
  18. # simulacion de un dado
  19. import random
  20.  
  21. print("Simulación de un dado")
  22. while True:
  23.    print('''
  24.    1. Arrojar el dado
  25.    2. Salir
  26.    ''')
  27.    
  28.    opcion = input("> ")
  29.    if opcion == "1":
  30.        print(random.randint(1,6))
  31.    
  32.    elif opcion == "2":
  33.        print("Fin de la simulación")
  34.        break
  35.        
  36.    else:
  37.        print("Opción incorrecta")
  38.    
  39. """
  40.    
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement