from random import choice


def ChooseWord(choices,Nword,posLabel,posVocab):
    """
    Chooses a word of a given part of speech, then removes that word from the dictionary.
    Inputs:
        choices     The dict of selected words
        Nword       The number of words of that part of speech to take
        posLabel    Label for tis part of speech
        posVocab    The array of words for that part of speech
    Returns:
        choices     The updated dict of selected words
    """
    for word in range(0,Nword):
        # Pick a word
        newWord = choice(posVocab)
        # Add the word to the choices dict
        choices[posLabel+str(word)]=newWord
        # Remove the word so that it will not be selected twice
        posVocab.remove(newWord)
    return choices