[Tutor] Is this correct syntax for what I want?

Alan Gauld alan.gauld at freenet.co.uk
Fri Jun 23 22:48:38 CEST 2006


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" <falcon3166 at hotmail.com>
To: <tutor at 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 




More information about the Tutor mailing list