Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- """
- Escribir un programa que le permita al usuario ingresar un conjunto de
- notas, preguntando a cada paso si desea seguir haciendolo. Cuando deje
- de ingresarlas, imprimir el promedio y terminar el programa
- """
- while True:
- notas = []
- suma = 0
- while True:
- nota = int(input("Ingrese una nota: "))
- notas.append(nota)
- suma = suma + nota
- opcion = input("Presione cualquier tecla si desea continuar ingresando notas ('W' para salir): ")
- if opcion.casefold() == "w":
- break
- print(f"El promedio de las notas ingresadas es {suma/len(notas)}")
- opcion = input("Presione cualquier tecla si desea continuar usando el programa ('X' para salir): ")
- if opcion.casefold() == "x":
- print("Gracias por usar este programa.....")
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement