Why does my while loop still run even if the conditions for it to run aren't met? : <p>I am currently working on a make your own adventure game. In the code, there is a while loop to check if the input given by the person running the game is valid or invalid.</p>

<pre><code>actions = ['turn light on']

while True:
    while player_input not in actions:
        print('i dont know what you mean by',player_input)
        player_input = input('&gt;')

if player_input == ('turn light on'):
    actions.remove('turn light on')
    actions.append('go to kitchen')
    actions.append('turn light off')

    points = int(points+100)

    print('you have',points,'points')
    print('it is bright in your room')
    print('you hear your dad say something in the kitchen')

    player_input = input('&gt;')

    if player_input == ('go to kitchen'):
        actions.remove('go to kitchen')
        actions.remove('turn light off')
        actions.append('eat eggs')
        actions.append('eat bacon')
        actions.append('eat dad')

        print('you go to the kitchen and your dad asks what you want for breakfast')
        print('do you want to eat bacon or eggs')
</code></pre>

<p>It works fine when you are at the 'turn light on part', but when you get to the go to the kitchen part and type 'go to kitchen' it prints what it is supposed to (you go to the kitchen and your dad asks what you want for breakfast, do you want bacon or eggs) but it also prints (i don't know what you mean by go to kitchen).</p>
