Strange infinite loop


#1



https://www.codecademy.com/en/courses/python-beginner-en-4XuFm/2/5?curriculum_id=4f89dab3d788890003000096

It just runs function pl_shooting() once(asks input from player) and then loops between two "elif"s infinitely ignoring functions pl_shooting() and pc_shooting() for some reason. So eventually computer just juggles variable turn and switches it's value between 'pc' and 'pl'. What's going on? O_o

Actually it should run pl_shooting or pc_shooting and switching between them every turn. But pc_shooting doesn't run for some reason at all and pl_shooting runs only once.


while pl_life() and pc_life():
        if turn == '0':
            if dice == 0:
                pl_shooting()
                turn = 'pc'
            else:
                pc_shooting()
                turn = 'pl'
        elif turn == 'pl':
            pl_shooting
            turn = 'pc'
        elif turn == 'pc':
            pc_shooting
            turn = 'pl'
        else:
            print 'Error'


#2

You've got three diverent versions of pl_shooting in your code:
pl_shooting()
pc_shooting()
pc_shooting

You can decide which of those you need to use.


#3

You're missing parenthesis:


#4

Ye, you're right. ) Thanks.


#5

Actually there are two of them, but I missed parenthesies. But thanks for the tip anyway. )