Okay, i've been working on this assignment for hours. I'm a total python newb but i've done pretty well so far. I'm stumped now though. I was hoping someone could point me in the right direction as to why i'm getting the error message below. The program is supposed to accept a list of denominations and a list of quantities and output a final value. We were never taught what that error message means so i'm not even sure where to start :/.
Any hints?
Evaluating a2.py
Traceback (most recent call last):
File "/Users/xavier/<string>", line 30, in <module>
File "/Users/xavier/<string>", line 21, in calcValue
TypeError: 'list' object is not callable
def calcValue (denom, quantities):
newlist = list()
i = 0
i2 = 0
finalval=0
while i < len(denom):
x = denom(i) * quantities(i)
newlist.append(x)
i = i + 1
while i2 < len(newlist):
finalval = finalval + newlist(i2)
i2 = i2 + 1
return finalval
x = [10000, 5000]
y = [1, 1]
print calcValue(x,y)