
A class inside another class is known as nested class
class Student:
def __init__(self, rollno, name):
self.rollno = rollno
self.name = name
def show(self):
print("Rollno = ",self.rollno)
print("Name = ",self.name)
class Marks:
def __init__(self, m1, m2, m3):
self.m1=m1
self.m2=m2
self.m3=m3
def show(self):
print("Marks = ",self.m1, self.m2, self.m3)
s1=Student(1,'user1')
s1.show()
marks1=Student.Marks(10,20,30)
marks1.show()
Ad: