title: 'list' object has no attribute, why is that?
body: <p>I am trying to pass in a list of items through a class parameter and call the method <code>display_flavors</code> to print the list. But I am receiving a <code>list object has no attribute error</code>.</p>
  
  <p>I have rewritten the code that works but I want to rewrite the code to pass in a list instead of calling the method and passing through the list argument. Is it possible? </p>
  
  <pre class="lang-py prettyprint-override"><code># Python script Idea to be implemented which has an error
  class IceCreamStand(Restaurant):  # Inherits the Parent Class "Restaurant"
      """Attempt to represent an Ice Cream Stand"""
      def __init__(self, restaurant_name, cuisine_name, flavors):
          """Initialize the attributes of an Ice Cream Stand"""
          super().__init__(restaurant_name, cuisine_name) 
          self.flavors = flavors
  
      def display_flavors(self):
          """Print all the flavors the Ice Cream Stand offers"""
          print("These are flavors offered in this Ice Cream Stand:")
          for flavor in self.flavors:
              print(flavor.title())
  
  list_of_flavors = ["chocolate", "strawberry", "banana"]
  restaurant1 = IceCreamStand("Dairy King", "Dairy and Ice Cream", list_of_flavors)
  restaurant1.flavors.display_flavors() 
  
  </code></pre>
  
  <p>========================================================================
  Rewritten code that works</p>
  
  <pre class="lang-py prettyprint-override"><code>class IceCreamStand(Restaurant):  # Inherits Parent Class "Restaurant"
       """Attempt to represent an Ice Cream Stand"""
      def __init__(self, restaurant_name, cuisine_name):
          """Initialize the attributes of an Ice Cream Stand"""
          super().__init__(restaurant_name, cuisine_name)
  
      def display_flavors(self, flavors):
          """Print all the flavors the Ice Cream Stand offers"""
          print("These are flavors offered in this Ice Cream Stand:")
          for flavor in flavors:
              print(flavor.title())
  
  list_of_flavors = ["chocolate", "strawberry", "banana"]
  restaurant1 = IceCreamStand("Dairy King", "Dairy and Ice Cream")
  restaurant1.display_flavors(list_of_flavors)
  </code></pre>
  
  <p>========================================================================</p>
  
  <pre><code>AttributeError: 'list' object has no attribute 'display_flavors'
  </code></pre>