I learned Object Oriented Programming recently and I have these Problems when I make run for this code , I have this error How Can I Fix it ?
class Grade:
def __init__(self,**kwargs):
self.information = kwargs
def grade(self):
g = self.information['grade']
print(g , "Grade")
def students(self):
s = self.information['students']
print("students : ",s)
def chairs(self):
c = self.information['chairs']
print("Chairs : ",c)
class school(Grade):
def __init__(self,**kwargs):
self._grades = kwargs
def classes(self):
print("YOU HAVE IN THE SCHOLL ",self._grades["classes"],"classes")
def students(self):
super().students()
first = Grade(grade="first" , students=20,chairs=15)
fir_g = school(classes=9)
fir_g.students()
Error:
Traceback (most recent call last):
File "c:\Users\hp\Desktop\python\OOP.py", line 27, in <module>
fir_g.students()
File "c:\Users\hp\Desktop\python\OOP.py", line 19, in students
super(school,self).students()
File "c:\Users\hp\Desktop\python\OOP.py", line 8, in students
s = self.information['students']
AttributeError: 'school' object has no attribute 'information'
How can Fix this problem ?