Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- """ Programa de administración de alumnos
- """
- lista = []
- print("Administración de alumnos")
- print("-------------------------")
- while True:
- print("""\nMenú de opciones:
- 1. Calificar alumnos
- 2. Ver calificaciones
- 3. Salir""")
- opcion = input("Seleccione su opción: ")
- if opcion == "1":
- nombre = input("Ingrese el nombre del alumno: ") # manuel alvear
- nota = input("Ingrese su nota: ") # 9
- alumno = [nombre, nota] # alumno = ["manuel alvear", "9"]
- lista.append(alumno) # lista = [["manuel alvear", "9"],....]
- elif opcion == "2":
- if len(lista) == 0:
- print("No hay ningún alumno ni nota cargada")
- else:
- for nombre, nota in lista:
- print(f"El alumno {nombre} tiene la nota {nota}")
- elif opcion == "3":
- print("Hasta luego....")
- break
- else:
- print("Opción incorrecta...")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement