Can any one help with solving this program it just doesnt take probability of the second team
Arun Nair
nairarunv at gmail.com
Thu Oct 26 03:38:59 EDT 2006
Thanks a ton peter its working.
Peter Otten wrote:
> Arun Nair wrote:
>
> > ''' Can anyone help me with this program it just takes probability of
> > the first team and runs the program doesnt takes the probability of the
> > second team even though specified'''
>
> > def simGame(probA, probB):
> > scoreA = 0
> > scoreB = 0
> > serving = "A"
> > while not gameOver(scoreA, scoreB):
> > if serving == "A":
> > if random() < probA:
> > scoreA = scoreA + 1
> > else:
> > serving == "B"
>
> Hint: this is not an assignment.
>
> > else:
> > if random() < probB:
> > scoreB = scoreB + 1
> > else:
> > serving == "A"
>
> Same thing.
>
> > return scoreA, scoreB
>
> Peter
More information about the Python-list
mailing list