def update_display_word(guess, rand_word, display_word):
    """
    Returns updated display based on user's guess.
    ex: _ a _ a _ _
    """
    # Remove the spaces so it matches the length of rand_word.
    display_word = display_word.replace(' ', '')
    result = ''

    for i in range(len(rand_word)):
        if rand_word[i] == guess:
            result += guess
        else:
            result += display_word[i]

    # Join the list back together with spaces.
    return ' '.join(list(result))