nim game by python?
<p>The rule of the game is that you've been given 3 piles of sticks. First pile has 3, second has 5 and last one has 7 sticks. Two players take turn to remove the sticks on each pile but the pick has to more than one and less than the amount of sticks on that pile.  who picks the last sticks will win the game.</p>

<p>Question: the first time pick is fine, the sticks are cut off as the way it supposed to be, but on second time, it goes back to initial status.</p>

<pre><code>def bill_board():
    player=1
    pile_1='*'*3
    pile_2='*'*5
    pile_3='*'*7
    player=1
    print('Player ',player,"'s Turn",sep='')
    print('1: ',pile_1)
    print('2: ',pile_2)
    print('3: ',pile_3)

def pile_input():
    while True:    
        while True: 
            pile=int(input('pile? '))
             if pile in range(1,4):
                break
            print('illegal choose: only 1-3')

        if pile==1:
            while True:
                stick=int(input('Sticks? '))
                pile_1='*'*3
                pile_2='*'*5
                pile_3='*'*7
                length_1=len(pile_1)
                if stick&gt;0 and stick&lt;=length_1:
                    break
                    print('bad choose')
            length_1=len(pile_1)    
            pile_1=length_1-stick
            pile_1='*'*pile_1
            print('1: ',pile_1)`enter code here`
            print('2: ',pile_2)
            print('3: ',pile_3)

        elif pile==2:
            while True:
                stick=int(input('Sticks? '))
                pile_1='*'*3
                pile_2='*'*5
                pile_3='*'*7
                length_2=len(pile_2)
                if stick&gt;0 and stick&lt;=length_2:
                    break
                    print('bad choose')
            length_2=len(pile_2)
            pile_2=length_2-stick
            pile_2='*'*pile_2
            print('1: ',pile_1)
            print('2: ',pile_2)
            print('3: ',pile_3)

        else:
            while True:
                stick=int(input('Sticks? '))
                pile_1='*'*3
                pile_2='*'*5
                pile_3='*'*7
                length_3=len(pile_3)
                if stick&gt;0 and stick&lt;=length_3:
                    break
                    print('bad choose')
            length_3=len(pile_3)
            pile_3=length_3-stick
            pile_3='*'*pile_3
            print('1: ',pile_1)
            print('2: ',pile_2)
            print('3: ',pile_3)


def game():
    print('Welcome to NIM!!!')
    print()
    bill_board()
    pile_input()
game()`enter code here`
</code></pre>