# Class methods = Allow operations related to the class itself # Take (cls) as the first parameter, which represents the class itself. # Instance methods = Best for operations on instances of the class (objects) # Static methods = Best for utility functions that do not need access to class data # Class methods = Best for class-level data or require access to the class itself class Student: count = 0 total_gpa = 0 def __init__(self, name, gpa): = name = gpa += 1 += gpa #INSTANCE METHOD def get_info(self): return f"{ } { }" @classmethod def get_count(cls): return f"Total # of students: { }" @classmethod def get_average_gpa(cls): if == 0: return 0 else: return f"Average gpa: { / :.2f}" student1 = Student("Spongebob", 3.2) student2 = Student("Patrick", 2.0) student3 = Student("Sandy", 4.0) print( ()) print( ())











