View Single Post
Old May 3rd, 2008, 5:24 PM   #5
Chuckiferd
Programmer
 
Join Date: Nov 2007
Posts: 64
Rep Power: 1 Chuckiferd is on a distinguished road
Re: Are nested lists indestructable?

cool then I can divide that by 4 to figure out how many nested lists there are.

You know ever since last night everything seems to be going wrong, I am adding the code to make each list unique and different. Look at whats happening

namelist=['Fred', 'Joe', 'Edward', 'Eric', 'John', 'Ryan', 'Chuck', 'Henry', 'Jean', 'Robert', 'Guido', 'Alan', 'Nicolas', 'Bill']
def whrstat():
  dice=randint(0, 13)
  whrname=namelist[dice]
  att=randint(1, 5)
  deff=randint(1, 5)

whrstat()
att                               x
deff                             y
aa=[whrname, att, deff, 1]
whrstat()                      
att                                x
deff                               y; ect. ect. ect.
ab=[whrname, att, deff, 1]
whrstat()
att
def
ac=[whrname, att, deff, 1]
whrstat()
att
def
ad=[whrname, att, deff, 1]
whrstat()
att
def
ae=[whrname, att, deff, 1]
whrstat()
att
def
af=[whrname, att, deff, 1]
whrstat()
att
def
ag=[whrname, att, deff, 1]
whrstat()
att
def
ah=[whrname, att, deff, 1]
whrstat()
att
def
ai=[whrname, att, deff, 1]
whrstat()
att
def
aj=[whrname, att, deff, 1]
abspirlist=[aa,ab,ac,ad,ae,af,ag,ah,ai,aj] 
dice=randint(0,4)
dice
del abspirlist[:dice]
shuffle(abspirlist)

Lets just say x=4 and y=3

>>>print abspirlist
[Guido, 4, 3, 1]
__________________
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