title: How can I resolve the return statement problem in python?
body: <p>Since a function call (with return statement) in python, means that a variable (outside the function) can receive its value. But what we don't realize is that it actually calls the whole function, in place the function call is used? Even if you use a return statement.</p>
  <p>Consider the following code -</p>
  <pre><code>def fnx():
      
      a = 0
      print(&quot;Hello! I'm function.&quot;)
      a = 2 + 4
      return a
  
  val = fnx()
  
  print(&quot;\n 2 + 4 =&quot;,val)
  </code></pre>
  <p>Its output -</p>
  <pre><code>Hello! I'm function.
  
   2 + 4 = 6
  </code></pre>
  <p>The problem with its working is, when you only want the value of variable a in variable val, the print statement of the function should not be passed in place of the function call for its returnable value.
  Can you tell me a way ,a method, a module etc. (except 'global'), that can only assign the return variable, while not passing the whole function in the place of the function call?</p>