class Const:
def __init__(self, firstName, lastName):
self.firstName = firstName
def hello(self):
print("hello world this is my sentence")
c = Const("hello", "world")
print(c.firstName)
c.hello()
# Instance Method Example in Python
class Student:
def __init__(self, a, b):
self.a = a
self.b = b
def avg(self):
return (self.a + self.b) / 2
s1 = Student(10, 20)
print( s1.avg() )