![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Newbie
Join Date: Apr 2006
Location: Newcastle, Australia
Posts: 4
Rep Power: 0
![]() |
Clarification Nested Lists
Hello, I was reading Python Essential Reference by Beazley. It had the following example on nested lists
Quote: a = [1,”Dave”,3.14, [“Mark”, 7, 9, [100,101]], 10] a[1] # Retruns Dave a[3][2] # Returns 9 a[3][3][1] # Returns 101 I just need to confirm something I am having trouble clarifying with the other docs I have found - I think maybe its too simple a question. Could I reference 7 above with a[4] as well as a[3][1]? So again referring to the above example of a[3][3][1] returns 101 why couldn't it be referenced as a[6][1] or do I need a new [] to represent each nest in the list? Finally could I negative reference a[-1] to equal 101 or does this create too much confusion ?
__________________
The problem with reality is that leaves a lot to the imagination - John Lennon |
|
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Assigning an array of lists | deanosrs | C | 42 | Apr 13th, 2006 1:35 PM |
| Linked Lists | Eric the Red | C++ | 6 | Mar 19th, 2006 12:47 AM |
| Nested Lists | Mjordan2nd | Python | 2 | Oct 22nd, 2005 3:41 PM |
| For Each ... Next, Nested Array issues. | ChefBoiAreDee | Visual Basic | 2 | Mar 2nd, 2005 4:26 PM |
| Nested Loop Question | kent666 | C++ | 3 | Feb 26th, 2005 10:21 AM |