xxxxxxxxxx
# A Sample class with init method
class Person:
# init method or constructor
def __init__(self, name):
self.name = name
# Sample Method
def say_hi(self):
print('Hello, my name is', self.name
:)
xxxxxxxxxx
class MyClass:
def __init__(self, param1, param2):
self.param1 = param1
self.param2 = param2
# Creating an instance of MyClass
my_object = MyClass("Hello", 123)
# Accessing the instance attributes
print(my_object.param1) # Output: Hello
print(my_object.param2) # Output: 123
xxxxxxxxxx
class brilliantUser(object):
def __init__(self, name, age, rating):