Operation "Killdeer"

Your code works for me however there’s a couple of issues. First, avoid using global variables whenever you can. The enemy definition belongs in the while True loop. Second, you should always check for the existence of the enemy before doing anything like attacking. In this case you can do this by changing else to elif enemy.