title: AttributeError: 'tuple' object has no attribute 'price'
body: <p>As a homework I have got to do a Linked List with Nodes as its objects while nodes would carry the <code>Car class</code> as their data. Not sure if I'm doing this right, but my friends tried to help me and this is what I have:</p>
  <pre><code>class Car:
      def __init__(self, identification = None, name = None, brand = None, 
          price = None, active = None):
              self.identification = identification
              self.name = name
              self.brand = brand
              self.price = price
              self.active = active
  
  class Node:
      def __init__(self, data):
          self.prevNode = None
          self.nextNode = None
          self.data = data
  
  class LinkedList:
      def __init__(self):
          self.head = None
  
      def insertNode(self, car):
          newNode = Node(car)
          curNode = self.head
          if self.head is None:
              self.head = newNode
          elif newNode.data.price &lt; curNode.data.price:
              newNode.nextNode = self.head
              self.head.prevNode = newNode
              self.head = newNode
          else:
              while curNode.nextNode is not None and curNode.nextNode.data.price &lt;= newNode.data.price:
                  curNode = curNode.nextNode
              newNode.nextNode = curNode.nextNode
              curNode.nextNode = newNode
  
  db = LinkedList()
  
  def init(cars):
      for car in cars:
          db.insertNode(car)
  
  def add(car):
      db.insertNode(car)
  
  def updateName(identification, name):
      curNode = db.head
      while curNode.data.id != identification:
          curNode = curNode.next
      curNode.data.name = name
  
  def activateCar(identification):
      curNode = db.head
      while curNode.data.id != identification:
          curNode = curNode.next
      curNode.data.active = True
  
  def calculateCarPrice():
      total = 0
      for i in range(db):
          if db[i].data.active == True:
              total += db[i].data.price
          i += 1
      return total
  
  car1 = (1, 'a', 'audi', 3000, True)
  car2 = (1, 'b', 'bmw', 5000, False)
  cars = [car1, car2]
  init(cars)
  </code></pre>
  <p>In my eyes, everything should be OK, but it returns this error when I call the <code>init</code> function.</p>
  <blockquote>
  <p>Traceback (most recent call last):</p>
  <p>File &quot;C:/Users/Matyas/Desktop/ZAL/Cvičení/showroom.py&quot;, line 89, in </p>
  <blockquote>
  <p>init(cars)</p>
  </blockquote>
  <p>File &quot;C:/Users/Matyas/Desktop/ZAL/Cvičení/showroom.py&quot;, line 40, in init</p>
  <blockquote>
  <p>db.insertNode(car)</p>
  </blockquote>
  <p>File &quot;C:/Users/Matyas/Desktop/ZAL/Cvičení/showroom.py&quot;, line 26, in insertNode</p>
  <blockquote>
  <p>elif newNode.data.price &lt; curNode.data.price:</p>
  </blockquote>
  <p>AttributeError: 'tuple' object has no attribute 'price'</p>
  </blockquote>
  <p>I don't understand why it even returns '<code>tuple</code>'..</p>