Advertisement
teslariu

plantilla while true

May 27th, 2021
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.52 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. #
  4. while True:
  5.    
  6.     ######### mi programa  ##########################
  7.    
  8.     edad = int(input("Por favor, ingrese su edad: "))
  9.     if edad >= 18:
  10.         print("Mayor de edad")
  11.     else:
  12.         print("Menor de edad")
  13.  
  14.     #################################################
  15.    
  16.     opcion = input("Presione cualquier tecla para continuar ('x' para salir): ")
  17.     if opcion.lower() == "x":
  18.         print("Gracias por usar este programa, hasta luego...")
  19.         break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement