class Student:
def __init__(self,x,y,z):
self.name=x
self.rollno=y
self.marks=z
def display(self):
print("name:",self.name)
print("rollno:",self.rollno)
print("marks:",self.marks)
s=Student("anil",100,90)
s.display()
output:
name: anil
rollno: 100
marks: 90
def __init__(self,x,y,z):
self.name=x
self.rollno=y
self.marks=z
def display(self):
print("name:",self.name)
print("rollno:",self.rollno)
print("marks:",self.marks)
s=Student("anil",100,90)
s.display()
output:
name: anil
rollno: 100
marks: 90
No comments:
Post a Comment