Re: [Tutor] Indexing a list with nested tuples

2011-08-05 Thread Christopher King
On Tue, Aug 2, 2011 at 10:44 PM, Alexander Quest alexxqu...@gmail.comwrote: have [0] to indicate that I want to go to the second value within that first item, which is the point value Actually [0] is the first element. I would go with [1]. ___ Tutor

Re: [Tutor] Indexing a list with nested tuples

2011-08-05 Thread Alexander Quest
My bad- meant to say [1]. Thanks. -Alexander On Fri, Aug 5, 2011 at 12:36 PM, Christopher King g.nius...@gmail.comwrote: On Tue, Aug 2, 2011 at 10:44 PM, Alexander Quest alexxqu...@gmail.comwrote: have [0] to indicate that I want to go to the second value within that first item, which is

Re: [Tutor] Indexing a list with nested tuples

2011-08-03 Thread Peter Otten
Alexander Quest wrote: Hi guys- I'm having a problem with a list that has nested tuples: attributes = [(strength, 0), (health , 0), (wisdom , 0), (dexterity, 0)] I've defined the list above with 4 items, each starting with a value of 0. The player enters how many points he or she

Re: [Tutor] Indexing a list with nested tuples

2011-08-03 Thread bob gailer
On 8/2/2011 11:39 PM, Alexander Quest wrote: Hey Bob- thanks for the reply. Here is a more complete part of that code section (the ellipses are parts where I've deleted code because I don't think it's important for this question): Please always reply-all so a copy goes to the list. Thanks

Re: [Tutor] Indexing a list with nested tuples

2011-08-03 Thread Alexander Quest
Thanks Peter- I tried the replacement method where the entire tuple is replaced with a new one and that worked. Changing the attribute_index (or selection variable, as I called it) to an integer removed the int/str errors. -Alex On Wed, Aug 3, 2011 at 12:12 AM, Peter Otten __pete...@web.de

Re: [Tutor] Indexing a list with nested tuples

2011-08-03 Thread Alexander Quest
Hi Bob- thanks for the reply again. I apologize about not replying all last time- still getting in the habit of doing this. I am using Python version 3.1. As far as tuples are concerned, I don't NEED to use them, but I am trying to get some practice with them. This is because I am following an

[Tutor] Indexing a list with nested tuples

2011-08-02 Thread Alexander Quest
Hi guys- I'm having a problem with a list that has nested tuples: attributes = [(strength, 0), (health , 0), (wisdom , 0), (dexterity, 0)] I've defined the list above with 4 items, each starting with a value of 0. The player enters how many points he or she wants to add to a given item. The

Re: [Tutor] Indexing a list with nested tuples

2011-08-02 Thread bob gailer
On 8/2/2011 10:44 PM, Alexander Quest wrote: Hi guys- I'm having a problem with a list that has nested tuples: attributes = [(strength, 0), (health , 0), (wisdom , 0), (dexterity, 0)] I've defined the list above with 4 items, each starting with a value of 0. The player enters how many