
Python | Self
Self is used to represent the instance of the class. With this keyword, you can access the attributes and methods of the class in python. It binds the attributes with the given arguments.
class Student:
def __init__(self, name, roll):
self.name = name
self.roll = roll
def display(self):
print("Name: ", self.name)
print("Roll: ", self.roll)