Skip to content

Instantly share code, notes, and snippets.

@hector117
Created March 30, 2017 20:54
Show Gist options
  • Save hector117/cef14177bbec77e4122ee57ce859a5db to your computer and use it in GitHub Desktop.
Save hector117/cef14177bbec77e4122ee57ce859a5db to your computer and use it in GitHub Desktop.
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