A python algorithm on reading the roll no.,name and marks of three subjects for a student and find the percentage obtained?
Answers
Answer:
please first be safe and stay at home OK friend be safe please
Explanation:
Write a program to build a simple Student Management System using Python which can perform following operations:
Accept
Display
Search
Delete
Update
Approach: Below is the approach to do the above operations:
Accept – This method takes details from the user like name, roll number, and marks for two different subjects.
# Method to enter new student details
def accept(self, Name, Rollno, marks1, marks2 ):
# Creates a new class constructor
# and pass the details
ob = Student(Name, Rollno, marks1, marks2 )
# list containing objects of student class
ls.append(ob)
Display – This method displays the details of every student.
# Function to display student details
def display(self, ob):
print("Name : ", ob.name)
print("RollNo : ", ob.rollno)
print("Marks1 : ", ob.m1)
print("Marks2 : ", ob.m2)
print("\n")
Search – This method searches for a particular student from the list of students.
This method will ask the user for roll number and then search according to the roll number
# Search Function
def search(self, rn):
for i in range(ls.__len__()):
# iterate through the list containing
# student object and checks through
# roll no of each object
if(ls[i].rollno