I try to get an array of averages from a list but there are some gaps then as a condition that I do not use that empty values
list = [1, "", 1,2,4, ""]
how to add an if wing instruction so that it does not use the NoneType and exit error
promedio = [sum(lista[:i+1])/float(i+1) for i in range(len(lista)-1)]
This is a mistake that marks me
promedio = [sum(lista[:i+1])/float(i+1) for i in range(len(lista)-1)]
TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'