To calculate grade of students in python, you have to ask from user to enter marks obtained in 5 subjects and calculate the sum of all the marks and then average marks to find the grade according to the average marks obtained by student as shown in the given below
2)b)) To calculate grade of students in python, you have to ask from user to enter marks obtained in 5 subjects and calculate the sum of all the marks and then average marks to find the grade according to the average marks obtained by student as shown in the given below
sub1=int(input("Enter Marks Obtained In Subject 1:"))
sub2=int(input("Enter Marks Obtained In Subject 2:"))
sub3=int(input("Enter Marks Obtained In Subject 3:"))
sub4=int(input("Enter Marks Obtained In Subject 4:"))
sub5=int(input("Enter Marks Obtained In Subject 5:"))
sum=(sub1+sub2+sub3+sub4+sub5)
avg=sum/5
print("Total Marks is :",sum)
print("Percentage :",avg)
if (avg>=90):
print("O Grade")
elif (90>avg>=80):
print("A+ Grade")
elif(80>avg>=70):
print("A Grade")
elif(70>avg>=60):
print("B+ Grade")
elif(60>avg>=50):
print("B Grade")
elif(50>avg>=40):
print("C Grade")
else:
print("F Grade")
Comments
Post a Comment