title: How to access nested dictionary in python
body: <p>How to access nested dictionary in python. I want to access '<strong>type</strong>' of both card and card1. </p>
  
  <pre><code>data = {
  '1': {
  'type': 'card',
  'card[number]': 12345,
  },
  '2': {
  'type': 'wechat',
  'name': 'paras'
  }}
  </code></pre>
  
  <p>I want only type from both the dictionary. how can i get.
  I use the following code but getting error:</p>
  
  <pre><code>&gt;&gt;&gt; for item in data:
  ...     for i in item['type']: 
  ...             print(i)
  ... 
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 2, in &lt;module&gt;
  TypeError: string indices must be integers
  </code></pre>