Answers for "3.Write a program that has a class student that stores roll number, name, and marks (in three subjects) of the students. Display the information (roll number, name, and total marks) stored about the student?"

C
0

3.Write a program that has a class student that stores roll number, name, and marks (in three subjects) of the students. Display the information (roll number, name, and total marks) stored about the student?

class Student():
	def __init__(self):
		self.name=input()
 		self.roll_no=input()
 		self.marks=[int(i) for i in input('enter the marks obtained in three subj
 	def Display(self):
 		print('Name:',self.name)
 		print('Roll no:',self.roll_no)
 		print('Total marks:',sum(self.marks))
a1=Student()
a1.Display()
Posted by: Guest on July-12-2021

Code answers related to "3.Write a program that has a class student that stores roll number, name, and marks (in three subjects) of the students. Display the information (roll number, name, and total marks) stored about the student?"

Code answers related to "C"

Browse Popular Code Answers by Language