class Student:
def read(self):
print("Reading student class")
s=Student()
s.read()
outputL
Reading student class
you can call multiple times
class Student:
def read(self):
print("Reading student class")
s=Student()
s.read()
s.read()
s.read()
s.read()
output:
Reading student class
Reading student class
Reading student class
Reading student class
example 2:
class Student:
def __init__(self,x,y,z):
self.name=x
self.rollno=y
self.marks=z
s=Student("anil",100,90)
print(s.name,s.rollno,s.marks)
output:
anil 100 90
def read(self):
print("Reading student class")
s=Student()
s.read()
outputL
Reading student class
you can call multiple times
class Student:
def read(self):
print("Reading student class")
s=Student()
s.read()
s.read()
s.read()
s.read()
output:
Reading student class
Reading student class
Reading student class
Reading student class
example 2:
class Student:
def __init__(self,x,y,z):
self.name=x
self.rollno=y
self.marks=z
s=Student("anil",100,90)
print(s.name,s.rollno,s.marks)
output:
anil 100 90