Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- #
- """
- Hacer un script que pida el ingreso de notas de un alumno. La carga debe terminar cuando se ingrese la nota igual a -1. En ese momento, deben mostrar la cantidad de notas, la nota máxima, la nota mínima y el promedio con dos cifras de exactitud
- """
- notas = []
- while True:
- nota = input("Ingrese una nota: ")
- if nota.isdigit() and 0 < int(nota) <= 10:
- notas.append(int(nota))
- elif nota == "-1":
- break
- else:
- print("Error en el ingreso de la nota")
- print(f"Cantidad de notas: {len(notas)}")
- print(f"Nota máxima: {max(notas)}")
- print(f"Nota mínima: {min(notas)}")
- print(f"Promedio de notas: {sum(notas)/len(notas):.2f}")
Advertisement
Add Comment
Please, Sign In to add comment