title: Python: Capitalize a word using string.format()
body: <p>Is it possible to capitalize a word using string formatting? For example,</p>
  
  <pre><code>"{user} did such and such.".format(user="foobar")
  </code></pre>
  
  <p>should return "Foobar did such and such."</p>
  
  <p>Note that I'm well aware of <code>.capitalize()</code>; however, here's a (very simplified version of) code I'm using:</p>
  
  <pre><code>printme = random.choice(["On {date}, {user} did la-dee-dah. ",
                           "{user} did la-dee-dah on {date}. "
                           ])
  
  output = printme.format(user=x,date=y)
  </code></pre>
  
  <p>As you can see, just defining <code>user</code> as <code>x.capitalize()</code> in the <code>.format()</code> doesn't work, since then it would also be applied (incorrectly) to the first scenario. And since I can't predict fate, there's no way of knowing which <code>random.choice</code> would be selected in advance. What can I do?</p>
  
  <p><em>Addt'l note:</em> Just doing <code>output = random.choice(['xyz'.format(),'lmn'.format()])</code> (in other words, formatting each string individually, and then using <code>.capitalize()</code> for the ones that need it) isn't a viable option, since <code>printme</code> is actually choosing from ~40+ strings.</p>