The var keyword has been a rather controversial addition to the C# language. Many developers initially fear it, getting lost in demos that use it. Eventually, they come to understand it as something "lazy" programmers would use and often dismiss it. I've gone through these stages. I even remember my blood boiling when I saw resharper, out of the box, suggest to use it! I never really understood it as anything more than implicit typing. Recently, I decided that I should learn new concepts with new ......
def WeightedAverage(items, value, weight):
numerator = sum(value(i) * weight(i) for i in items)
divisor = sum(weight(i) for i in items)
return (numerator / divisor) if divisor != 0 else None