for this excercise i have to create a function which censors certain words
Is what ive done completely wrong or is it nearly there, and if so what should i do to make it work

your else clause is not doing anything useful, you can remove it

palabra contains read-only values from the list, changes made to it won’t persist given the loop assigns a new value to it each iteration of the loop

you need to find a way to make the censoring persist

two common ways:

  1. update elements in the list which needs censoring (updating elements in a list requires
    indexes, which function did we learn to get indexes for list?
  2. create a new list, use if/else to append censored/uncensored words to the new list