class student:
def __init__(self, class_student, name, GPA=0,number_of_course=0, number_of_credits=0):
self.class_student= class_student
self.name= name
self.GPA= GPA
self.number_of_course=number_of_course
self.number_of_credits= number_of_credits
def add_course(self,GPA, number_of_credits):
return student(self.class_student,self.name, self.GPA,self.number_of_course,self.number_of_credits)
mylad= student('Senior', 'Ardy', 2.7, 0, 0)
print(mylad.add_course(3.2, 3))
This code displays <main.student object at 0x7ff427458460>. I am a beginner at Python and do not know how to fix this. If anyone can help me I would appreciate it very much!