title: I would like to print out a formatted dictionary in Python
body: <p>I've been working on creating a store in Python. I would like to print out the dictionary I made that stores the items for the store, but by using a format I created by redefining <code>__str__</code>. Is there a way I could do this by creating a loop?</p>
  
  <pre><code>class Store():
  def __init__(self):
      self.available_items = []
      self.customer_list = []
  
  
  class Inventory():
      def __init__(self, name, stock, price):
          self.name = name
          self.stock = stock
          self.price = price
  
      def __str__(self):
          return 'Name: {0}, Stock: {1}, Price: {2}'.format(self.name, self.stock, self.price)
  
  
  # Store name is listed along with its database of items
  amazon = Store()
  
  amazon.available_items = {
      111: Inventory('Ice Cubes', 10, 7.99),
      121: Inventory('Butter', 8, 4.99),
      131: Inventory('Radio', 70, 17.99),
      141: Inventory('Underwear', 15, 3.99),
      151: Inventory('Coffee', 17, 2.99)
      }
  
  
  print(amazon.available_items[111])
  
  for items in amazon.available_items:
      print items
  </code></pre>