import random as rnd def introduction(): print("Tell the user what is goning on") print("etc.") print("etc.") print("something elsse")' def getInputs(): numberOfGames=int(input("Please enter the number of games to be played/simulated: ")) probPlayerAWins=float(input("Enter the probability Player A wins any one game, 0-1: ")) probPlayerBWins=float(input("Enter the probability Player B wins any one game, 0-1: ")) return numberOfGames,probPlayerAWins,probPlayerBWins def simulateNGames(n,probA,probB): winsA=0 winsB=0 for gameNumber in range(n): scoreA,scoreB = simulateGame(probA,probB) if scoreA>scoreB: winsA=winsA+1 else: winsB=winB+1 return winsA,winsB def simulateGame(probA,probB): serving = "A" scoreA=0 scoreB=0 while not(gameOver(scoreA,scoreB)): if serving == "A": if rnd.random()<=probA: scoreA=scoreA+1 else: serving = "B" else: if rnd.random()<=probB: scoreB=scoreB+1 else: serving = "A" return scoreA,scoreB def gameOver(scoreA,scoreB): return scoreA==15 or scoreB==15 def summary(winsA, winsB): print9"game play stats') print("report winsA") print("report winsB") print(".....") def main(): introduction() n, probA, probB = getInputs() winsA,winsB = simulateNGames(n,probA,probB) summary(winsA,winsB)