title: How can I assign a function to a variable without running it?
body: <p>Whenever I assign a variable to a function, it runs the function. As a result, if I were to have a print statement in the function, it would print the text even though all I want to do is assign but not run the function. I don't believe this is the case in many other programming languages such as C++, so is there a core concept that I'm missing here?</p>
  
  <pre><code>def function(x):
      print("Text From Function")
      return 3*x
  
  y = function(2)
  </code></pre>
  
  <p>I expect there to be no output but the actual output is:
  Text From Function</p>