Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- #
- """
- Script que muestra un cuenta regresiva de 10 a 0, mostrando los números
- segundo a segundo
- Ayuda: usar la biblioteca time y la función sleep
- Ej: time.sleep(3)
- import time
- i = 10
- for i in range(10,-1,-1):
- print(i)
- time.sleep(1)
- """
- # escribir un script que tenga un menu y permita generar nros aleatorios
- # entre 1 y 6 como si fuera un dado
- # Menu
- # 1. Tirar dado
- # 2. Salir
- # ayuda: usar random y la función randint
- import random
- while True:
- print("\nMenu")
- print("1 tirar dado ")
- print("2 salir")
- opcion = input("ingrese una opcion: ")
- if opcion == "1":
- print(random.randint(1, 6))
- elif opcion == "2":
- print("gracias por usar este programa")
- break
- else:
- print("error ")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement