title: Functions with AttributeError: 'NoneType' object has no attribute 'replace'
body: <p>My mini program takes a string from user input and adds dots between each letter and then removes these dots.</p>
  <p>The function <code>add_dots</code> takes the string and adds dots. I have a separate function called <code>remove_dots</code> that then removes them.</p>
  <p>Here is the code below:</p>
  <pre><code>def add_dots(str):
    str = &quot;.&quot;.join(str)
    print(str)
  
  def remove_dots(str):
    str.replace(&quot;.&quot;, &quot;&quot;)
    print(str)
  
  word = input(&quot;Enter a word: &quot;)
  </code></pre>
  <p>When I call the two functions individually with</p>
  <pre><code>add_dots(word)
  remove_dots(word)
  </code></pre>
  <p>I get the expected console output of</p>
  <pre><code>Enter a word: hello
  h.e.l.l.o
  hello
  </code></pre>
  <p>However, when I try to call</p>
  <pre><code>remove_dots(add_dots(word))
  </code></pre>
  <p>I get an error <code>AttributeError: 'NoneType' object has no attribute 'replace'</code></p>
  <p>I understand that this means the <code>str</code> variable has the value of <code>None</code> but I'm not sure why? Can anyone advise. Thanks</p>