[snip] > > class Computer: > > def __init__(self): > > self.points = 0 > > self.choice = " " > > > > def plays(self): > > comp_choice = random.randint(0,2) > > if comp_choice == 0: > > self.choice = 'rock' > > elif comp_choice == 1: > > self.choice = 'paper' > > else: > > self.choice = 'scissors'
this could be shortened to 'comp_choice = random.choice(['rock','paper','scissors'])' _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor