title: Beginner Python: AttributeError: 'list' object has no attribute
body: <p>The error says:</p>
  
  <pre><code>AttributeError: 'list' object has no attribute 'cost' 
  </code></pre>
  
  <p>I am trying to get a simple profit calculation to work using the following class to handle a dictionary of bicycles:</p>
  
  <pre><code>class Bike(object):
      def __init__(self, name, weight, cost):
          self.name = name
          self.weight = weight
          self.cost = cost
  
  bikes = {
      # Bike designed for children"
      "Trike": ["Trike", 20, 100],
      # Bike designed for everyone"
      "Kruzer": ["Kruzer", 50, 165]
      }
  </code></pre>
  
  <p>When I try to calculate profit with my for statement, I get the attribute error.</p>
  
  <pre><code># Markup of 20% on all sales
  margin = .2
  # Revenue minus cost after sale
  for bike in bikes.values():
      profit = bike.cost * margin
  </code></pre>
  
  <p>First, I don't know why it is referring to a list, and everything seems to be defined, no?</p>