title: 'str' object has no attribute 'get' -Learn Python The Hard Way EX39
body: <p>I am a python beginner. I try to write my hometown city with dictionary after practicing ex39 of Learn Python The Hard Way.</p>
  
  <p>Here are what I wrote:</p>
  
  <pre><code>    states = {
      'Orangon': 'OR',
      'Florida': 'FL',
      'California': 'CA',
      'New York': 'NY',
      'Michigan': 'MI',
  }
  
  for state, abbrev in states.items():
      print "%s is abbreviated %s" % (state, abbrev)
  
  print states.get('Florida')
  print states.get('California')
  
  
  cities = {
      'New Taipei': 'NTP',
      'Taipei': 'TP',
      'Kaohsiung': 'KHU',
      'Taichung': 'TAC',
      'Taoyuan': 'TYN',
      'Tainan': 'TNA',
      'Hsinchu': 'HSC',
      'Keelung': 'KLG',
      'Chiayi': 'CYI',
      'Changhua': 'CHA',
      'Pingtung': 'PTG',
      'Zhubei': 'ZBI',
      'Yuanlin': 'Yln',
      'Douliu': 'Dlu',
      'Taitung': 'TAT',
      'Hualien': 'HUl',
      'Toufen': 'TFE',
      'Yilan': 'Yln',
      'Miaoli': 'Mli',
      'Magong': 'Mgn',
  }
  
  for cities, abbrev in cities.items():
      print "%s is %s" % (cities, abbrev)
  
  print cities.get('Magong')
  </code></pre>
  
  <p>There is error in the last code:</p>
  
  <p>Traceback (most recent call last):
    File "ex39.2.py", line 27, in 
      print cities.get('Magong')
  AttributeError: 'str' object has no attribute 'get'</p>
  
  <p>I don't understand why there is no error in <code>print states.get('California')</code> but there is error in <code>print cities.get('Magong')</code></p>