words = ["apple", "bad", "cherry"] forbidden = "bad" answer = [] for i in range(len(words)): if words[i] != forbidden: answer.append(words[i]) print(answer)
To embed this project on your website, copy the following code and paste it into your website's HTML: