DEV Community

loading...

Day 22 of 100DaysOfCode : Simple Program To Find Grade Of Students

iamdurga profile image Durga Pokharel ・2 min read

Today is my 22th day of #100DaysOfCode and #python. Today I did not learned new thing more. I revised course which is already completed by me from programming for everybody on coursera.

I tried to write some python code in mathematical problem. Did some part of my simple project on basic CSS. And I tried to write simple python program to find out the grade of students from their marks.

Simple Grade Finder Program

My program is given below. In the program we give marks of each subject either integer or float type. After all marks were given we calculate total of marks and find out percentage . After that we can use if else statement to find grade. My program is given below.

English = float(input('Please enter the english marks:'))
Nepali = float(input('Please enter the nepali marks:'))
Social = float(input('Please enter the social marks:'))
Computer = float(input('Please enter the computer marks:'))
Mathematics = float(input('Please enter the mathematics marks:'))
Population = float(input('Please enter the population marks:'))
Moral = float(input('Please enter the moral marks:'))
Optmath = float(input('Please enter the optmath marks:'))
Total = English + Nepali + Social + Computer + Mathematics + Population + Moral + Optmath 
Percentage = (Total /800)* 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')


Enter fullscreen mode Exit fullscreen mode

After running this program we can get following output.

Please enter the english marks:90
Please enter the nepali marks:80
Please enter the social marks:77
Please enter the computer marks:98
Please enter the mathematics marks:78
Please enter the population marks:78
Please enter the moral marks:88
Please enter the optmath marks:89
Total Marks = 678.00
Marks percentage = 84.75
B Grade
Enter fullscreen mode Exit fullscreen mode

Discussion (0)

pic
Editor guide