title: Can I call a function in Python from a print statement?
body: <p>I'm new to python and I am exploring. Now in the following code, I am trying to call a function from a print statement, is it legal? </p>
  
  <pre><code># My func
  def summer(num1,num2):
  print "The summation of the numbers is: %d " % (num1+num2)
  
  num1 = raw_input("Enter a number: ")
  num2 = raw_input("Enter another number: ")
  
  print "Again, the summation: %d " % (summer(num1,num2))
  
  print "That is the end of the program."
  </code></pre>
  
  <p>Now is the line</p>
  
  <pre><code> print "Again, the summation: %d " % (summer(num1,num2))
  </code></pre>
  
  <p>valid? I am getting an error.<br>
  Can I call a function in this manner, from a string? Thank you.</p>
  
  <p>The error that I get is:</p>
  
  <pre><code>  Traceback (most recent call last):
    File "myfunc.py", line 9, in &lt;module&gt;
    summer(num1,num2)
    File "myfunc.py", line 3, in summer
    print "The summation of the numbers is: %d " % (num1+num2)
    TypeError: %d format: a number is required, not str
  </code></pre>