Original Post
Hello...I have been trying to write a simple program that can save and load lists. I am not very experienced with python at all, and so I seem to have gotten stuck at this point... What I'm trying to do is read a list that looks like this:
logList=[
['date','name','quantity','cost','total'],
['date2','name2','quantity2','cost2','total2'],
]
..and then add up all the "totals" in that list. The code I was trying to do it with is:
def getTotal():
for date,name,quant,cost,total in logList :
rtm2 = total
runttlent.delete(0, END)
runttlent.insert(0, rtm2)
That inserts rtm2 into an entry widget (using Tkinter..). Now, as you probably guessed, "rtm2 = total" only gives me a single value...I have no idea how to add up every value in the 'total' spot on that list :-/. Any help would be appreciated...thanks in advance. [Edited by - ryguy4377 on March 22, 2007 12:33:50 PM]