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

Popular posts from this blog

Write a python program to compute cumulative product of a list of numbers (write function cumulative_product).

Write a Python program to compute distance between two points taking input from the user. Formula for Pythagorean theorem for compute distance between two points is: