class Student:
numbr_of_student=0
def __init__(self,name,age,courses):
self.name = name
self.age = age
self.courses = courses
Student.numbr_of_student+=1
student_1=Student("achref",11,["math"])
student_2=Student("azzedine",12,["science"])
print(student_1,student_2)
Output:
<__main__.Student object at 0x000001BA4347FD00> <__main__.Student object at 0x000001BA4347FC40>
What is the problem?
>Solution :
You are printing 2 objects of the "student" class. When you call print, it is showing you the objects.
What you probably want is print the attributes:
print(student_1.name, student_1.age, student_1.courses)
You can also read this to see how to do get all attributes at once: Print all properties of a Python Class