title: Read dict values one by one from dictionary in python
body: <p>I am new to python. I want to read dict values one by one from dictionary in python and print the output.
  I am using below code and the issue is it is returning only the last query output.</p>
  <pre><code>def pk_record_count_check(localdf):
  
      try:
          sql = 'select count(distinct ' + localdf[&quot;business_key_name&quot;] + ') as PK_CNT from ' + localdf[&quot;schema_table&quot;]
          sql = sql.to_dict()
          pd.set_option(&quot;display.max_colwidth&quot;, None)
          for new_sql in sql.values():
              df = new_sql
              print(df)
          loging(datetime.datetime.now(), '-', df)
          df3 = pd.read_sql_query(df, db_connection)
          print (df3)
          return df3.PK_CNT[0]
  </code></pre>
  <pre><code>Current output 
  &quot;df&quot;
  select count(distinct PersonID) as PK_CNT from testdb.DimCurrency
  select count(distinct `index`) as PK_CNT from testdb.banking_fraud
  select count(distinct S_No) as PK_CNT from testdb.banking_fraud
     PK_CNT
  0    1000
  </code></pre>
  <pre><code>Expected output: it should return every query output.
     PK_CNT
  0    0
     PK_CNT
  0    1000
     PK_CNT
  0    1000
  </code></pre>