title: Python- AttributeError: 'function' object has no attribute 'course_code'
body: <p>Third question for the day. But this one is a brand new program. So now I'm receiving this error (and before you say my code is riddled with errors, I'm expecting that.):</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:/Users/DDeahr/Downloads/College_Student.py", line 58, in &lt;module&gt;
      main()
    File "C:/Users/DDeahr/Downloads/College_Student.py", line 46, in main
      Alex.complete_class("English 101", 10)
    File "C:/Users/DDeahr/Downloads/College_Student.py", line 30, in complete_class
      College_Student.complete_class.course_code += self.courses_done
  AttributeError: 'function' object has no attribute 'course_code'
  </code></pre>
  
  <p>New error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:/Users/DDeahr/Downloads/College_Student.py", line 1, in &lt;module&gt;
      class College_Student(object):
    File "C:/Users/DDeahr/Downloads/College_Student.py", line 30, in College_Student
      course_code = staticmethod(course_code)
  NameError: name 'course_code' is not defined
  </code></pre>
  
  <p>Here's my code: </p>
  
  <pre><code>class College_Student(object):
      total = 0
      enrolled = []
  
      def __init__(self, first_name, last_name, id_num, courses_done, credit_hrs):
          self = self
          self.first_name = first_name
          self.last_name = last_name
          self.id_num = id_num
          self.courses_done = [],
          self.credit_hrs = credit_hrs
  
      def __str__(self):
          first_name = self.first_name
          last_name = self.last_name
          id_num = self.id_num
          courses_done = self.courses_done
          credit_hrs = self.credit_hrs
          College_Student.total += 1
          College_Student.enrolled += self.last_name
          College_Student.enrolled.sort()
          return "First Name: %s\nLast Name: %s\nID Number: %s\nCourses Finished: %s\nCredit Hours: %s\n" % (self.first_name, self.last_name, self.id_num, self.courses_done, self.credit_hrs)
  
      def complete_class(self,course_code,student_credit_hrs):
          self.credit_hrs += student_credit_hrs
          self.courses_done = []
          College_Student.complete_class.course_code += self.courses_done
          return "Student with ID number: %s has finished course %s which is %s credit hours." % (self.id_num, self.course_code, self.student_credit_hours)
  
      def can_grad(self):
          if self.credit_hrs &gt;= 120:
              return "Student with ID number: %s can now graduate." % (self.id_num)
          else:
              return "Student with ID number: %s cannot graduate yet." % (self.id_num)
  
  def main():
      print "Creating student John"
      John = College_Student("John", "Appleseed", 111111, None, 20)
      print John
      print "Creating student Alex"
      Alex = College_Student("Alex", "Trannon", 222222, None, 30)
      print Alex
      Alex.complete_class("English 101", 10)
      Alex.complete_class("Mathmatics 102", 20)
      Alex.complete_class("Computer Sciences 208", 60)
      John.complete_class("Psychology 5005", 40)
      John.complete_class("English 108.365", 2)
      John.complete_class("Chinese 101", 10)
      John.complete_class("Computer Sciences 30", 28)
      Alex.can_grad()
      John.can_grad()
      print total
      print enrolled
  
  main()
  </code></pre>
  
  <p>Any and all help is much appreciated! Thank You!</p>