DEV Community

Durga Pokharel
Durga Pokharel

Posted on

1

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

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

Day 22 of #100DaysOfCode and #Python3
* More about python function, list, loop, variable
* Revised programming for everybody from https://t.co/wGKlbeTnDyCoursera
* Simple program to find the grade sheet of students pic.twitter.com/19Ks64U0pA

— Durga Pokharel (@mathdurga) January 15, 2021

AWS Q Developer image

Your AI Code Assistant

Automate your code reviews. Catch bugs before your coworkers. Fix security issues in your code. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay