<filename>All Python Practice - IT 89/Weighted Average.py<gh_stars>0
#!/usr/bin/python

#-------------------------------
#  Name: Weighted Average.py
#  Coded by <NAME>
#-------------------------------

def WeightedAverage() :

    n = input('\nWant some value to calculate weighted average? ')
    m = float()
    a = float()

    for i in range(0,n) :

        x = input('\nEnter values of the quantity: ')
        w = input('Enter values of the corresponding weights: ')
        m += x*w
        a += w

    j = m/a

    print '\nWeighted Average: ',j,'\n'

<filename>All Python Practice - IT 89/Weighted Average.py<gh_stars>0
#!/usr/bin/python

#-------------------------------
#  Name: Weighted Average.py
#  Coded by <NAME>
#-------------------------------

def WeightedAverage() :

    n = input('\nWant some value to calculate weighted average? ')
    m = float()
    a = float()

    for i in range(0,n) :

        x = input('\nEnter values of the quantity: ')
        w = input('Enter values of the corresponding weights: ')
        m += x*w
        a += w

    j = m/a

    print '\nWeighted Average: ',j,'\n'

#!/usr/bin/python #------------------------------- #  Name: Weighted Average.py #  Coded by <NAME> #-------------------------------