# Python And The Replace Method

**URL:** <https://forum.freecodecamp.org/t/python-and-the-replace-method/46880>\
**Category:** General\
**Created:** [October 19, 2016, 9:52am UTC](https://forum.freecodecamp.org/t/python-and-the-replace-method/46880 "2016-10-19T09:52:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wilcombebolger](https://avatars.discourse-cdn.com/v4/letter/w/47e85d/32.png) [@wilcombebolger](https://forum.freecodecamp.org/u/wilcombebolger)\
**Post date:** [October 19, 2016, 9:52am UTC](https://forum.freecodecamp.org/t/python-and-the-replace-method/46880/1 "2016-10-19T09:52:12Z")

</div>

I am having to make a simple chatbot for my Uni module using python.  
Now I have a list of “stop-words” (about 50 of them) that through a “for loop” each word has to be inputted and replaced with an empty string object " ",

So for example  
stop\_words = [“a”, “and”, “the”] etc there are approximately 50 words  
for word in stop\_words:  
stop\_word.replace(“a”, " ", 1)

I don’t know how to make the for loop run through the list and replace each of the 50+ words with " " empty text and how to check that it has worked.

Could anyone please help me here

---

<div class="post-metadata">

**Author:** ![jwilkins.oboe](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jwilkins.oboe/32/179497_2.png) [@jwilkins.oboe](https://forum.freecodecamp.org/u/jwilkins.oboe)\
**Post date:** [January 16, 2021, 5:30am UTC](https://forum.freecodecamp.org/t/python-and-the-replace-method/46880/2 "2021-01-16T05:30:43Z")

</div>

Closed on January 16, 2021, 5:30am UTC


