what am i missing here? it's storing every variable as the same card. generate the 'cards' in nested loops, i use a commented out print statement to verify the values are legit one step above appending them to a list, yet when I look at the list later, every 'card' is the same card -the last card made-
def PrintCard(i):
print i.suit,i.value
class CardClass():
value = 0
face = ""
suit = 0
slot = 0
onoff = 0
card = []
decks = 1
x = 1
suits = [0,1,2,3]
values = [2,3,4,5,6,7,8,9,10,10,10,10,11]
n = CardClass()
for d in range(decks):
for s in suits:
n.suit = s
for v in values:
n.value = v
"print s,v, n.suit,n.value"
card.append(n)
for i in range(len(card)):
PrintCard(card[i])