Write a python program to store the name and marks of students usingclasses. (Use list to store marks in 3 subjects).
class student:
def __init__(self,n,m):
self.name=n
self.marks=m
def display(self):
print(self.name,self.marks)
n=input("enter name:")
m=list(map(int,input("enter list").split()))
s1=student(n,m)
s1.display()
Comments
Post a Comment