On Thu, 22 Dec 2005 19:43:15 GMT in comp.lang.python, "David M. Synck" <[EMAIL PROTECTED]> wrote:
[...] > temp = float(raw_input("Please enter the first credit \n")) > > while temp != 0: > credlist.append(temp) > temp = float(raw_input("Please enter the next credit \n")) Here you're building credlist as a list of floats. > > i = 0 This is wasted effort > for i in credlist: You've asked to loop through credlist, so each value of i is going to be float. Maybe you should rename i to something that looks less like an index and more like a credit. > credits += credlist[i] Here, you're trying to indexa list with a float. No can do... [...] >TypeError: list indices must be integers ...ss it's telling you here > > >If anyone can point me in the right direction, I would greatly appreciate >it. I think what you want is for cr in credlist: credits += cr Which could also be implemented as credits = reduce(lambda x,y: x+y, credlist) HTH, -=Dave -- Change is inevitable, progress is not. -- http://mail.python.org/mailman/listinfo/python-list