title: Why does .format(function()) not work, but % prints the value?
body: <p>Code that I wrote:  </p>
  
  <pre><code>def ball(f):  
      py_ball = f * 5
      u_ball = py_ball / 10  
      return py_ball, u_ball
  print("py ball: {}, u ball: {}".format(ball(100)))
  </code></pre>
  
  <p>When I use <code>str.format</code>, it throws an exception:</p>
  
  <pre>
  Traceback (most recent call last):
    File "rear.py", line 5, in 
      print("py ball: {}, u ball: {}".format(ball(100)))
  IndexError: tuple index out of range
  </pre>
  
  <p>But if I use <code>%</code> formatting:</p>
  
  <pre><code>print("py ball: %d, u ball: %d" % ball(100))
  </code></pre>
  
  <p>it works just fine and produces:</p>
  
  <pre><code>py ball: 500, u ball: 50
  </code></pre>