How can I share attribute in other class

16 views
Skip to first unread message

Dariusz Mysior

unread,
Apr 18, 2015, 7:08:31 AM4/18/15
to django...@googlegroups.com
I have two class, and I want use in method first_distribution_cards self.players from first class how can I do this?

class Game(object):

 
def __init__(self,name):
 
self.players=[]
 
self.dealer=Person("Dealer")
 
self.name=name
class Deck(object):

def first_distribution_cards(self):
 
for player in self.players:
 
for card in range(0,5):
 
self.player.hand.append(self.cards)
 
print(self.player.hand[card])




Reply all
Reply to author
Forward
0 new messages