Geeks With Blogs
My Blog geek yapping
	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
Posted on Sunday, September 6, 2009 2:17 PM python | Back to top


Comments on this post: Weighted Average in python

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Wes McClure | Powered by: GeeksWithBlogs.net