0
Usar numpy
Intento hacer esto con la librería numpy pero no se me activa https://sololearn.com/compiler-playground/coVprQ2kGi8t/?ref=app
1 Réponse
+ 2
There are lots of mistakes. See my comments on the corrected code:
import math
import numpy
def stats(x,y,z):
a=[x,y,z]
stat = {} # you named the dictionary like the function
med = numpy.mean(a)
stat.update({"media":med}) # media is not defined, you need to mark it as string
var = numpy.var(a) # you forgot numpy
stat.update({"varianza":var}) # see media
std = numpy.std(a) # you forgot numpy
stat.update({"dt":std}) # see media
return stat
x=float(input()) # must be a number
y=float(input()) # must be a number
z=float(input()) # must be a number
listado = stats(x,y,z)
print(listado)