The data is account name and 12.50 (example). I want to access the data to add and subtract from it. For example 12.50 - 2.25 = 10.25 10.25 + 4.75 = 15.00
Thanks, Nathan Pinno ----- Original Message ----- From: "Alan Gauld" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]>; <tutor@python.org> Sent: Friday, June 23, 2006 2:48 PM Subject: Re: [Tutor] Is this correct syntax for what I want? > Nathan, > > Can you show us an example of the data? > And what you want to do to it, ie before and after values. > > Its not clear to me whether you want to add the number to the > number while keeping it in the tuple (Which is impossible > because tuples are immutable) or whether you simply want > to access the data to use in an addition/subrtraction storing > the result elsewhere (which is perfectly possible) > > Alan G. > > ----- Original Message ----- > From: "Nathan Pinno" <[EMAIL PROTECTED]> > To: <tutor@python.org> > Sent: Friday, June 23, 2006 2:20 AM > Subject: [Tutor] Is this correct syntax for what I want? > > > I want to be able to add and subtract from a number in a tuple in a > list. Is this the correct syntax? > > letterlist[x] = letterlist[x] + amount # for addition > > letterlist[x] = letterlist[x] - amount # for subtraction > > If this is not correct, what is the correct syntax? > > Thanks, > Nathan Pinno > > > _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor