def get_action(player):
    '''Gets action of player.

    This is of similar design to the input loop found in main().
    A few more possibilities are handled.
    Note the inner-most logic.
    The line "hands[player].index(card)" is not needed because an exception is raised when trying to remove an item that does not exist.
    The line previosly mentioned has been left in place for historical purposes (documentation), and the line does not result in errors.
    Note "table.append((player, card))."
    A tuple on the table remembers who played what.'''
    asking = True
    while asking:
        try:
            card = int(raw_input('What card do you want to play? '))
            try:
                if card >= 0 and card <= 9:
                    hands[player].index(card)
                    hands[player].remove(card)
                    table.append((player, card))
                    asking = False
                else:
                    print 'Please enter a value between -1 and 10.'
            except:
                print 'You do not have that card.'
        except:
            print 'Please enter a number.'
Gets action of player.

    This is of similar design to the input loop found in main().
    A few more possibilities are handled.
    Note the inner-most logic.
    The line "hands[player].index(card)" is not needed because an exception is raised when trying to remove an item that does not exist.
    The line previosly mentioned has been left in place for historical purposes (documentation), and the line does not result in errors.
    Note "table.append((player, card))."
    A tuple on the table remembers who played what.
recipes/Python/440621_War_Game_Version_1/recipe-440621.py