title: How to capitalize every beginning of a sentence in a text in python?
body: <p>I want to create a function that takes as an input a string which is a text, and I want to capitalize every letter that lies after a punctuation. The thing is, strings don't work like lists so I don't really know how to do it, I tried to do this, but it doesn't seem to be working :</p>
  <pre><code>def capitalize(strin):
      listrin=list(strin)
      listrin[0]=listrin[0].upper()
      ponctuation=['.','!','?']
      strout=''
      for x in range (len(listrin)):
          if listrin[x] in ponctuation:
              if x!=len(listrin):
                  if listrin[x+1]!=&quot; &quot;:
                      listrin[x+1]=listrin[x+1].upper()
                  elif listrin[x+2]!=&quot; &quot;:
                      listrin[x+1]=listrin[x+1].upper()
      for y in range(len(listrin)):
          strout=strout+listrin[y]
      return strout
  </code></pre>
  <p>For now, I am trying to solve it with this string: '<code>hello! how are you? please remember capitalization. EVERY time.'</code></p>