title: object has no attribute(a simpe class)
body: <pre><code>class Student:
  
      def __init__(self, name, imt_name, semester):
          self.name = name
          self.imt_name = imt_name
          self.semester = semester
  
      def show_info(self):
          return ("%s [%s] in Semester %d"%(self.name, self.imt_name, self.semester))
  
      def __str__(self):
          return ("%s [%s] in Semester %d"%(self.name, self.imt_name, self.semester))
  
  </code></pre>
  
  <p>trying to create a class, but it seems that the second class doesnt work properly</p>
  
  <p>this is the second class:</p>
  
  <pre><code>class UniClass(Student):
  
      def __init__(self,name_class):
          self.name = name_class
          self.students = set()
  
  
      def enroll_student(self,students):
  
          if (type(students)==Student):
              return self.students.add(students)
  
  
      def __str__(self):
          if len(self.students)==0:
              return "set()"
          else:
              return super().show_info()
  </code></pre>
  
  <p>but there is an error
  <code>AttributeError: 'UniClass' object has no attribute 'imt_name'</code> Can someone fix my code?</p>
  
  <p>here is the assertion:</p>
  
  <pre><code>programming_class = UniClass("Programmieren")
  assert str(programming_class) == "set()"
  </code></pre>
  
  <pre><code>programming_class.enroll_student(student_horst)
  assert str(programming_class) == "{Horst [horst99] in Semester 20}"
  </code></pre>
  
  <pre><code>student_horst = Student("Horst2", "horst100", 20)
  student_horst2 = Student("Horst2", "horst100", 20)
  </code></pre>
  
  <pre><code>programming_class.enroll_student(student_horst2)
  assert str(programming_class) == "{Horst [horst99] in Semester 20, Horst2 [horst100] in Semester 20}" \
      or str(programming_class) == "{Horst2 [horst100] in Semester 20, Horst [horst99] in Semester 20}"
  </code></pre>