Function to censor single word in a sentence The following function censors a single word of choice in a sentence with asterisks, regardless of how many times the word appears. How can I further simplify this code? 

def censor(text,word):
  text_list = text.split()
  for i in range(0,len(text_list)):
    if text_list[i] == word:
      text_list[i] = '*' * len(text_list[i])
    else:
      continue
  return" ".join(text_list)
As mentioned in the comments, you could use str.replace() to replace all occurrences of a certain substring:

def censor(text, word):
   return text.replace(word, "*"*len(word))


To ensure that only entire words are replaced, though, you should use regular expressions:

import re

def censor(text, word):
    pattern = r"\b" + re.escape(word) + r"\b"
    return re.sub(pattern, "*"*len(word), text)


Unlike your original code, the regular expression solution also handles words that have punctuation attached.



Some other things to think about:


Your else: continue statement can be omitted;
Your function does not have a docstring. If you plan on making it a public function (as part of an API, for example), you should explain what arguments it expects and what it returns. If you plan on using it internally, at the very least, provide a single-line docstring explaining what the function does.
range() assumes start is 0 if no explicit start is passed, thus you can change it to for i in range(len(text_list)):