title: python error : 'str' object has no attribute 'upper()'
body: <p>I'm discovering possibilities of string formatting with .format( ) method in Python 3 but i raised an error that i do not understand.</p>
  
  <p>So, why the following line is ok [wich let me think that "0" can be used exactly like the argument passed to format()]:</p>
  
  <pre><code>s = 'First letter of {0} is {0[0]}'.format("hello")  
  #gives as expected: 'First letter of hello is h'
  </code></pre>
  
  <p>but not this one [applying a method or a function to 0 in {0} doesn't work?]:</p>
  
  <pre><code>s = '{0} becomes {0.upper()} with .upper() method'.format("hello")
  </code></pre>
  
  <p>raising the following error:</p>
  
  <pre><code>AttributeError: 'str' object has no attribute 'upper()'
  </code></pre>
  
  <p>Why the raised error says i've used upper as an attribute and not as a method?
  And is there another way to do it than:</p>
  
  <pre><code>s = '{} becomes {} with .upper() method'.format("hello","hello".upper())
  #gives as expected: 'hello becomes HELLO with .upper() method'
  </code></pre>
  
  <p>Thanks!</p>