title: How do you call a function in a function?
body: <p>I have a function and I'm making another one in which I need to call the first function. I don't have experience in Python, but I know that in languages like MATLAB it's possible as long as they're in the same directory.</p>
  
  <p>A basic example:</p>
  
  <pre><code>def square(x):
      square = x * x
  </code></pre>
  
  <p>(and saved)</p>
  
  <p>Now in my new function I want to use the function square I tried:</p>
  
  <pre><code>def something (y, z)
    import square
    something = square(y) + square(z)
    return something
  </code></pre>
  
  <p>Which displays: <code>builtins.TypeError: 'module' object is not callable</code>.</p>
  
  <p>What should I do?</p>