Created
March 30, 2017 20:54
-
-
Save hector117/cef14177bbec77e4122ee57ce859a5db to your computer and use it in GitHub Desktop.
This file contains 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
def promedio_lista(l): | |
p = 0 | |
for i in l: | |
p = p + i | |
t = p/x | |
return t | |
#main program below | |
l = [] | |
print("Problema 4 (Examen)") | |
x = int(input("Ingresa el número de valores que quieres que existan en tu lista ")) | |
for i in range(x): | |
n = float(input("Ingresa un número ")) | |
l.append(n) | |
a = promedio_lista(l) | |
print("El promedio de tu lista es de ",a) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment