https://www.codecademy.com/practice/projects/censor-dispenser
As you can see I have the negative_words list, but obviously I want it to work on any list I put in.
negative_words = ["concerned", "behind", "danger", "dangerous", "alarming", "alarmed", "out of control", "help", "unhappy", "bad", "upset", "awful", "broken", "damage", "damaging", "dismal", "distressed", "distressing", "concerning", "horrible", "horribly", "questionable"]
def handle_up_low(lst_of_wrds): #my function
new_lst = []
for word in lst_of_wrds:
new_lst.append(word.title())
new_lst.append(word.upper())
new_lst.append(word)
lst_of_wrds = new_lst
return lst_of_wrds
print(handle_up_low(negative_words))#prints out altered version
print(negative_words)#prints out original version
How can I keep the changes made to negative_words, or any list?