i am completely new to python and/or programming as a whole and i obviously still don’t even understand what i am doing ^^
could someone please tell me if my solution is okay or if there are any problems with it? i altered it for quite some time now … and that kinda got me really confused, to the point i was about to quit trying…i am not sure if for example all lines are necessary.
def censor(text, word): word_list = text.split() cen_list =  length = len(word_list) for i in range(0,length): if word_list[i] in word: cen_list.append("*" * len(word)) else: cen_list.append(word_list[i]) result = " ".join(cen_list) return result
Greetings from Austria and thanks in advance!
PS: sorry for any major mistakes in my post, it’s not my native language (and it isn’t python either )