title: How to loop through a dictionary with the class instances?
body: <p>I am a intern and try to implement a dictionary class. I need to loop  and print the objects from the class.
  My code is:</p>
  <pre><code>class Shop:
      def __init__(self,prodid, prodname, prodtype, prodrating):
          self.prodid = prodid
          self.prodname = prodname
          self.prodtype = prodtype
          self.prodrating = prodrating
  
  b1 = Shop(&quot;ID1&quot;, &quot;My-Bot1&quot;, &quot;Fashion1&quot;, 5)
  b2 = Shop(&quot;ID2&quot;, &quot;My-Bot2&quot;, &quot;Fashion2&quot;, 6)
  b3 = Shop(&quot;ID3&quot;, &quot;My-Bot3&quot;, &quot;Fashion3&quot;, 7)
  
  b4 = Shop(&quot;ID4&quot;, &quot;My-Bot2&quot;, &quot;new born&quot;, 6)
  b5 = Shop(&quot;ID5&quot;, &quot;My-Bot3&quot;, &quot;newborn&quot;, 7)
  
  myDict = {}
  myDict[&quot;clothing&quot;] =  [b1,b2,b3]
  myDict[&quot;infant&quot;] =  [b4,b5]
  
  for items in myDict.items():
      for item in items:
          print(item)
  </code></pre>
  <p>I am not able to loop through the class instances and print the values.</p>