Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old May 3rd, 2008, 2:29 PM   #1
Chuckiferd
Programmer
 
Join Date: Nov 2007
Posts: 64
Rep Power: 1 Chuckiferd is on a distinguished road
Are nested lists indestructable?

Hello I am trying to create a program that involves writing a whole bunch of lists with information of its specific topic then grouping them together. Normally I would use a hash but they don't really let you create a whole bunch of variables that can be withdrawn later.

So my problem is when I nest them together, based on a random factor I want to delete so many of them from the back, but nothing I write seems to work

I can see doing all this with a whole bunch of if: loops but I know there has to be some easier way

here is my program(at least the part that pertains to it)
(PS. all the importing and preperations are done I simply didn't print it)

a=randint(6,11)
aa=['name', 'att', 'def', 1]
ab=['name', 'att', 'def', 1]
ac=['name', 'att', 'def', 1]
ad=['name', 'att', 'def', 1]
ae=['name', 'att', 'def', 1]
af=['name', 'att', 'def', 1]
ag=['name', 'att', 'def', 1]
ah=['name', 'att', 'def', 1]
ai=['name', 'att', 'def', 1]
aj=['name', 'att', 'def', 1]
abspirlist=[aa,ab,ac,ad,ae,af,ag,ah,ai,aj]
del abspirlist[a:]
shuffle(abspirlist)
__________________
There are 10 kinds of people in this world, those who can read binary and those who can't.
Chuckiferd is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pointers and Linked Lists BstrucT C 8 Feb 11th, 2008 2:33 AM
Sorting integer lists sixstringartist Python 4 Dec 4th, 2007 2:27 PM
Clarification Nested Lists flebber Python 3 Aug 31st, 2006 10:24 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




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 8:17 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC