What is the need to define a function to return a class's attribute?
What is the need to define a function to return a class's attribute? Question: I came across some code like this class Student(Person): def __init__(self, age): self.age = age def get_age(self): return self.age Could you please explain the purpose of the function get_age()? If we want to know a student’s age, can’t we simply do …