title: Find Elements in Python Dict
body: <p>I am getting a python dictionary from AWS which is formatted like the following sample object:</p>
  
  <pre><code>{'ResponseMetadata': {'NOT IMPORTANT'},
   'hasMoreResults': True,
   'marker': '{"NOT IMPORTANT"}',
   'pipelineIdList': [{'id': 'df-0001',
                       'name': 'Blue'},
                      {'id': 'df-0002',
                       'name': 'Orange'},
                      {'id': 'df-0003',
                       'name': 'Green'},
                      {'id': 'df-0004',
                       'name': 'Red'},
                      {'id': 'df-0005',
                       'name': 'Purple'}
  ]}
  </code></pre>
  
  <p>I want to ask for the <code>name</code> of an input in <code>pipelineIdList</code> and get the <code>id</code> that matches with it.  For example, if you search using the input string "Red" you will get a return value of "df-0004"</p>
  
  <p>My code is as follows:</p>
  
  <pre><code>import boto3
  
  def findId(pipeline_list, inputString):
    for dict in pipeline_list:
      if dict['pipelineIdList']['name'] == inputString:
        return dict['id']
  
  def main():
    inputString = "Red"
  
    datapipeline = boto3.client('datapipeline')
    pipeline_list = datapipeline.list_pipelines() //This line returns a Dict like the one above
  
    result = findId(pipeline_list, inputString)
    print(result)
  
  
  if __name__ == "__main__":
    main()
  </code></pre>
  
  <p>The <code>print(result)</code> in this case with <code>inputString="Red"</code> should print a value of <code>df-0004</code>, but it instead prints absolutely nothing.  Any help with fixing this issue would be greatly appreciated.</p>