title: Python Index Error: string index out of range
body: <pre><code>## A little helper program that capitalizes the first letter of a word
  def Cap (s):
      s = s.upper()[0]+s[1:]
      return s 
  </code></pre>
  
  <p>Giving me this error :</p>
  
  <pre><code>Traceback (most recent call last):
    File "\\prov-dc\students\jadewusi\crack2.py", line 447, in &lt;module&gt;
      sys.exit(main(sys.argv[1:]))
    File "\\prov-dc\students\jadewusi\crack2.py", line 398, in main
      foundit = search_method_3("passwords.txt")
    File "\\prov-dc\students\jadewusi\crack2.py", line 253, in search_method_3
      ourguess_pass = Cap(ourguess_pass)
    File "\\prov-dc\students\jadewusi\crack2.py", line 206, in Cap
      s = s.upper()[0]+s[1:]
  IndexError: string index out of range
  </code></pre>