哪位能帮我看一下这是什么错误?

这是我的代码和错误,搞不懂为什么会有这种错误,希望能帮我解答

img

img

img

你输的那个冒号好像是中文的,第40行,多了个等号


from random import random


def printIntro():
    print('模拟选手A、B比赛')
    print('A、B的能力值以0和1之间的小数表示')


def getInputs():
    a = eval(input('A选手的能力者(0-1):'))
    b = eval(input('B选手的能力者(0-1):'))
    n = eval(input('比赛场次:'))
    return a, b, n


def printSummary(winsA, winsB):
    n = winsA + winsB
    print(f'分析开始,共模拟{n}场比赛')
    # print(f'选手A胜{winsA}场,胜率{(winsA / n) * 100}%')
    # print(f'选手B胜{winsB}场,胜率{(winsB / n) * 100}%')
    print('选手A胜{}场,胜率{:0.1%}'.format(winsA, winsA / n))
    print('选手B胜{}场,胜率{:0.1%}'.format(winsB, winsB / n))


def gameOver(a, b):
    return a == 15 or b == 15


def simOneGame(probA, probB):
    scoreA, scoreB = 0, 0
    serving = 'A'
    while not gameOver(scoreA, scoreB):
        if serving == 'A':
            if random() < probA:
                scoreA += 1
            else:
                serving = 'B'
        else:
            if random() < probB:
                scoreB += 1
            else:
                serving = 'A'
    return scoreA, scoreB


def simNGames(n, probA, probB):
    winsA, winsB = 0, 0
    for i in range(n):
        scoreA, scoreB = simOneGame(probA, probB)
        if scoreA > scoreB:
            winsA += 1
        else:
            winsB += 1
    return winsA, winsB


def main():
    printIntro()
    probA, probB, n = getInputs()
    winsA, winsB = simNGames(n, probA, probB)
    printSummary(winsA, winsB)


main()

img

img