Lesson 10 Censor: How can I get my results to print out?


#1

I know my code works but I don't know how to print out the results to see it for myself. Here's what I have:

text = raw_input("Write a sentence with no punctution: ")
word = raw_input("Enter a word you would like to censor out: ")


def censor(text,word):
    new_text = []
    chop_word = text.split()
    for x in chop_word:
        if x == word:
            y = "*" * len(word)
            new_text.append(y)
        else:
            new_text.append(x)
    return ' '.join(new_text)

#2

Print the result using print.

print censor(text,word)

(it works :), good job)


#3

Thanks Jacob, I though I had tried that but I guess I just had one of those moments.