title: How to loop through array of strings Python
body: <p>in order to execute this code, which basically deletes a word from a sentence, we have to use split.string in order to access words.</p>
  
  <pre><code> def censor(text, word):
       splitstring=text.split()
       for elem in range(len(splitstring)):
          if splitstring[elem]==word:
               splitstring[elem]='*'*len(word)
  
      return " ".join(splitstring)**strong text**
  </code></pre>
  
  <p>why can't we use use a "traditional" for-loop, as if looping through a word for a letter? </p>
  
  <pre><code>for word in text:
      for elem in word:
          if elem==word:
               word='*'*len(word)    """etc"""
  </code></pre>