def weighted_average(items, weights):
    """
    Returns the weighted average of a list of items.
    
    Arguments:
    items is a list of numbers.
    weights is a list of numbers, whose sum is nonzero.
    
    Each weight in weights corresponds to the item in items at the same index.
    items and weights must be the same length.
    """
    num = 0
    denom = 0
    assert len(items) > 0
    assert len(items) == len(weights)		#Verifying the lengths are equal
    for i in range(0,len(items)):
        num = num+(items[i]*weights[i])		#Calculate weighted avg
        denom += weights[i]
    return num/denom