i wana make a class that get a name and set it to random team between team A and team B and then sey it out but needs to be from 22 people and 11 in each team how can i make random not give me more than that amount that i want in python ?
i made this program but its not random on how many time maximum each of them have been chosen:
import random
class human:
count = 0
def __init__(self,name):
self.name = name
class fotbalist(human):
def get_name(self):
team = ['A','B']
self.team = random.choice(team)
print('%s is in %s team'%(self.name,self.team))
New contributor
PDK is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.