Created
February 9, 2024 04:15
-
-
Save Nosis/7ca0ecb556fab3df05908dff6fc78ae1 to your computer and use it in GitHub Desktop.
Reto Jueves
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| opcion = "" | |
| while opcion != "E": | |
| print("Menú:") | |
| print("A) Registrar nuevos usuarios") | |
| print("B) Listar usuarios") | |
| print("C) Ver información de un usuario") | |
| print("D) Editar información de un usuario") | |
| print("E) Salir") | |
| opcion = input("Elige una opción: ") | |
| if opcion == "A": | |
| pass | |
| elif opcion == "B": | |
| print("Los usuarios registrados son:") | |
| for i in range(len(id)): | |
| print(f"{i+1}) ID: {id[i]}") | |
| elif opcion == "C": | |
| indice = int(input("Ingresa el id del usuario que quieres ver: ")) | |
| if 0 < indice <= len(personas): | |
| print("La información del usuario es:") | |
| print(personas[indice-1]) | |
| else: | |
| print("Índice inválido") | |
| elif opcion == "D": | |
| indice = int(input("Ingresa el índice del usuario que quieres editar: ")) | |
| if 0 < indice <= len(personas): | |
| print("La información actual del usuario es:") | |
| print(personas[indice-1]) | |
| print("Ingresa los nuevos valores:") | |
| nombre = input("Escribe tu nombre(s): ") | |
| apellido = input("Escribe tus Apellidos: ") | |
| telefono = input("Escribe tu número de teléfono: ") | |
| correo = input("Escribe tu Correo electrónico: ") | |
| personas[indice-1] = { | |
| "nombre": nombre, | |
| "apellido": apellido, | |
| "telefono": telefono, | |
| "correo": correo | |
| } | |
| print("La información del usuario ha sido actualizada") | |
| else: | |
| print("Índice inválido") | |
| elif opcion == "E": | |
| print("El programa ha finalizado.") | |
| else: | |
| print("Opción inválida. Inténtalo de nuevo.") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment