What Students Say
Here are our students...
| Type | Instance Method | Class Method | Static Method | Constructor |
|---|---|---|---|---|
| Keyword Used | self | cls | None | self |
| Special Symbol | None | @classmethod | @staticmethod | __init__() |
| Common Use | Uses object data | Uses class data | Just a helper method, no self or cls | Runs when object is created |
class Student:
def show(self): # instance method
print("This is an instance method")
s = Student()
s.show() # Output: This is an instance method
class Student:
school = "ABC School"
@classmethod
def show_school(cls):
print("School name is:", cls.school)
Student.show_school() # Output: School name is: ABC School
class Student:
@staticmethod
def greet():
print("Welcome to the class!")
Student.greet() # Output: Welcome to the class!
class Student:
def __init__(self, name):
self.name = name
def show_name(self):
print("Name is:", self.name)
s = Student("Kiran")
s.show_name() # Output: Name is: Kiran
Here are our students...
Empower your tech dreams with us. Get in touch!




