human
Program for weighted mean of natural numbers . | Function to calculate weighted mean ..
Take num array and corresponding weight array and initialize it ..
Calculate the size of array ..
Check the size of both array is equal or not ."
How can the above be solved in Python?

=====
Write me a code to program for weighted mean of natural numbers?
assistant
#Here is code to program for weighted mean of natural numbers .
 def weightedMean ( X , W , n ) :
	sum = 0
	numWeight = 0
	i = 0
	while i < n :
		numWeight = numWeight + X [ i ] * W [ i ]
		sum = sum + W [ i ]
		i = i + 1
	return ( float ) ( numWeight / sum )
X = [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ]
W = [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ]
n = len ( X )
m = len ( W )
if ( n == m ) :
	print weightedMean ( X , W , n )
else :
	print " - 1"