Capitalizing hyphenated name
<p>I have a script looking like this:</p>

<pre><code>firstn = input('Please enter your first name: ') 
lastn = input('Please enter Your last name: ') 
print('Good day, ' + str.capitalize(firstn) + ' ' + str.capitalize(lastn)+ '!')
</code></pre>

<p>It will work nicely with simple names like jack black or morgan meeman but when I input hyphenated name like <code>jordan-bellfort image</code> then I'd expect <code>"Jordan-Bellfort Image"</code> but I receive <code>"Jordan-bellfort Image"</code>.</p>

<p>How can I get python to capitalize the character right after hyphen?</p>

<p>Use <a href="https://docs.python.org/2/library/string.html" rel="nofollow"><code>string.capwords()</code></a>instead</p>

<blockquote>
  <p>Split the argument into words using str.split(), capitalize each word
  using str.capitalize(), and join the capitalized words using
  str.join()</p>
</blockquote>

<pre><code>import string
string.capwords(firstn, "-")
</code></pre>

python capitalize