def censor(text, word):
    """takes two strings, text and word, as input and returns the text with the word you chose replaced with asterisks."""
    result = ""
    prep = text.split()
    list_pos_counter = 0
    for i in prep:
        if i == word:
            prep[list_pos_counter] = "*" * len(word)
        list_pos_counter += 1
    result = " ".join(prep)
    return result