grade calculation in python

Description

Python Program to get a mark of a stuent and find its grade.
Input:
75
Output:
C

Solution

mark=int(input("Enter Mark:"))
if(mark>95 and mark<=100):
    print("O Grade")
elif(mark>90 and mark<=95):
    print("A grade")
elif(mark>80 and mark<91):
    print("B Grade")
elif(mark>70 and mark<81):
    print("C Grade")
elif(mark>60 and mark<71):
    print("D Grade")
elif(mark>49 and mark<61):
    print("E Grade")
elif(mark>=0 and mark<50):
    print("F Grade")
else:
    print("Invalid Mark")
	

We are Teaching "Web Development using Python" through Online.

View Tutor Profile and Course Syllabus

Explanation

chained conditional check is used here to check the mark range. any one of the grade will be displayed.
Ramesh P Natarajan

Author - Ramesh P Natarajan

Software Developer and Technology Trainer, very much passionate in the field of Software Application Development, Machine Learning and Search Engine Optimization.

Write to: [email protected]





Interesting Pattern Programs: for more Patterns

Input:
5
Output:
*
**
***
****
*****
****
***
**
*Solution
Input:
5
Output:
    *
   ***
  *****
 *******
*********
 *******
  *****
   ***
    *Solution
Input:
5
Output:
*        *
**      **
***    ***
****  ****
**********Solution
Input:
5
Output:
*       *
**     **
***   ***
**** ****
*********Solution
Input:
5
Output:
*       *
**     **
***   ***
**** ****
*********
**** ****
***   ***
**     **
*       *Solution
Input:
5
Output:
*********
 *******
  *****
   ***
    *
   ***
  *****
 *******
*********Solution