top of page
learn_data_science.jpg

Data Scientist Program

 

Free Online Data Science Training for Complete Beginners.
 


No prior coding knowledge required!

Calculate Grade of students in Final Exams

In this blog, we are going to talk about How to calculate the overall grade of the student in the final exams.

The system of the grades in this college follow the following grading system



Our python application depends on taking input from the user in the 6 subjects by using the following line code

print("Enter Your Marks in 6 Subjects: ")
markOne = float(input())
markTwo = float(input())
markThree = float(input())
markFour = float(input())
markFive = float(input())
markSix = float(input())

The output will be like this:

Enter Your Marks in 6 Subjects: 
50
57.5
38
91
85
70

We take these inputs and we calculate the average by the following line code:

total =markOne+markTwo+markThree+markFour+markFive+markSix
avg = total/6

After that, we pass the avg to the cal_grade function to calculate the grade of the student

cal_grade(avg)

The cal_grade function calculates the grades as shown in the following code

def cal_grade(input_avg):
if input_avg>=91 and input_avg<=100:
    print("Your Grade is A1")
elif input_avg>=81 and input_avg<91:
    print("Your Grade is A2")
elif input_avg>=71 and input_avg<81:
    print("Your Grade is B1")
elif input_avg>=61 and input_avg<71:
    print("Your Grade is B2")
elif input_avg>=51 and input_avg<61:
    print("Your Grade is C1")
elif input_avg>=41 and input_avg<51:
    print("Your Grade is C2")
elif input_avg>=33 and input_avg<41:
    print("Your Grade is D")
elif input_avg>=21 and input_avg<33:
    print("Your Grade is E1")
elif input_avg>=0 and input_avg<21:
    print("Your Grade is E2")
else:
    print("Invalid Input!")

The output for the previous inputs will be

Your Grade is B2

you can refer to the complete code from the following link


Comments


COURSES, PROGRAMS & CERTIFICATIONS

 

Advanced Business Analytics Specialization

Applied Data Science with Python (University of Michigan)

Data Analyst Professional Certificate (IBM)

Data Science Professional Certificate (IBM)

Data Science Specialization (John Hopkins University)

Data Science with Python Certification Training 

Data Scientist Career Path

Data Scientist Nano Degree Program

Data Scientist Program

Deep Learning Specialization

Machine Learning Course (Andrew Ng @ Stanford)

Machine Learning, Data Science and Deep Learning

Machine Learning Specialization (University of Washington)

Master Python for Data Science

Mathematics for Machine Learning (Imperial College London)

Programming with Python

Python for Everybody Specialization (University of Michigan)

Python Machine Learning Certification Training

Reinforcement Learning Specialization (University of Alberta)

Join our mailing list

Data Insight participates in affiliate programs and may sometimes get a commission through purchases made through our links without any additional cost to our visitors.

bottom of page