Please help, censor dispenser

This is the censor dispenser challenge on codecademy!

I’ve been stuck at a particular part for awhile and honestly it’s been a struggle.

Been questioning if i’m an idiot who simply can’t learn.

I need your advice and please please help! I would appreciate them all.
<>
def holycowcensor(emailstring):

emailstring = emailstring.split()

for i in range(len(emailstring)):

for term in proprietary_terms:

  if emailstring[i] in term:

    emailstring = emailstring.replace(emailstring[i], '-')

    emailstring = emailstring.replace(emailstring[i-1], '-')

    emailstring = emailstring.replace(emailstring[i+1], '-')

for word in negative_words:

  if emailstring[i] in word:

    emailstring = emailstring.replace(emailstring[i], '-')

    emailstring = emailstring.replace(emailstring[i-1], '-')

    emailstring = emailstring.replace(emailstring[i+1], '-')

return ‘’.join(emailstring)

<>
This is the kind of coding i came up with. Ugly and terrible i know.
But i need your help in letting me learn please

https://www.codecademy.com/practice/projects/censor-dispenser

here’s the url.

I don’t want to despair since I am interested in comp sci as a degree

This is check 5 for the question btw. Sorry for not mentioning it