Python Program to find Student Grade

Write a Python program to find Student Grade with an example. For this, first, we have to calculate Total, and Percentage of Five Subjects. Next, use Elif to find the grade

Python Program to find Student Grade

This python program allows users to enter five different values for five subjects. Next, it finds the Total, and Percentage of those Five Subjects. For this Python example, we are using the Arithmetic Operators to perform arithmetic operations.

TIP: Elif statement check first condition. If it is TRUE, then it executes the statements present in that Python block. If the condition is FALSE, it checks the Next one (Elif condition) and so on.

# Python Program to find Student Grade
 
english = float(input(" Please enter English Marks: "))
math = float(input(" Please enter Math score: "))
computers = float(input(" Please enter Computer Marks: "))
physics = float(input(" Please enter Physics Marks: "))
chemistry = float(input(" Please enter Chemistry Marks: "))

total = english + math + computers + physics + chemistry
percentage = (total / 500) * 100

print("Total Marks = %.2f"  %total)
print("Marks Percentage = %.2f"  %percentage)

Python Student Grade output

 Please enter English Marks: 70
 Please enter Math score: 60
 Please enter Computer Marks: 90
 Please enter Physics Marks: 80
 Please enter Chemistry Marks: 85
Total Marks = 385.00
Marks Percentage = 77.00

Python Program for Student Grade Example 2

In this python program, we are using the Elif statement to find the grade.

# Python Program to find Student Grade
 
english = float(input(" Please enter English Marks: "))
math = float(input(" Please enter Math score: "))
computers = float(input(" Please enter Computer Marks: "))
physics = float(input(" Please enter Physics Marks: "))
chemistry = float(input(" Please enter Chemistry Marks: "))

total = english + math + computers + physics + chemistry
percentage = (total / 500) * 100

print("Total Marks = %.2f"  %total)
print("Marks Percentage = %.2f"  %percentage)

if(percentage >= 90):
    print("A Grade")
elif(percentage >= 80):
    print("B Grade")
elif(percentage >= 70):
    print("C Grade")
elif(percentage >= 60):
    print("D Grade")
elif(percentage >= 40):
    print("E Grade")
else:
    print("Fail”)
Python Program to find Student Grade 2