Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- """Script que pide notas del 1 al 10 y devuelve su promedio. El ingreso
- de notas debe finalizar al ingresar -1"""
- import mis_funciones
- print("""Script que pide notas del 1 al 10 y devuelve su promedio. El ingreso
- de notas debe finalizar al ingresar -1""")
- notas = []
- while True:
- nota = mis_funciones.ingresar_natural()
- if nota < 11:
- notas.append(nota)
- else:
- print("Ha ingresado un valor de nota inválido.")
- opcion = input("¿Más notas? (o -1 para terminar): ")
- if opcion == "-1":
- if notas:
- print(f"El promedio es {mis_funciones.promedio(notas):.2f}")
- else:
- print("No se han ingresado notas...")
- break
Advertisement
Add Comment
Please, Sign In to add comment