控件在第二次迭代中跳过该函数。为什么?

时间:2018-09-27 23:11:45

标签: python python-3.x

我的代码:

def player_input():
    global symbol1
    global symbol2
    """
    do something
    """
    marker=True      

def replay():
    game=True
    while(game==True):

        print('do you want to play?')
        option=input(' enter yes/no ')              
        if option=='no':
            game=False
            break
        while not(option=='YES'): 
            option=input('choose the right option')

        marker=player_input()

    print('see you around!...bye')


symbol1=''
symbol2=''
replay()

输出:

do you want to play?

 enter yes/no   yes

player1 :  x

player2 :  o

do you want to play?

 enter yes or no       yes

do you want to play?

 enter yes or no        

该控件未输入函数:player_input用于第二次迭代。 我希望每次调用player_input函数时输出都要求player1和player2

0 个答案:

没有答案