The marks obtained by a student in 3 different subjects are input by the user.
The marks obtained by a student in 3 different subjects are input by the user. Your program should calculate the average of subjects and display the grade. The student gets a grade as per the following rules:
- Average Grade
- 90-100 A
- 80-89 B
- 70-79 C
- 60-69 D
- 0-59 F
# Grade calculator
print("Enter the marks you recieved in three subjects")
max = int(input("maximum marks in Every Subject"))
mks1 = int(input("Enter marks in Subject 1 "))
mks2 = int(input("Enter marks in Subject 2 "))
mks3 = int(input("Enter marks in Subject 3 "))
total = ((mks1+mks2+mks3))
ptg = total*100/(3*max)
print("Your percentage ",ptg)
if 90 < ptg <= 100:
print("Grade is A")
elif 80 < ptg <= 89:
print("Grade is B")
elif 70 < ptg <= 79 :
print("Grade is C")
elif 60 < ptg <= 69:
print("Grade is D")
elif 0 < ptg <= 59:
print("Grade is F")
More in Python
See all →- Linear Regression Namaste doston! Aaj hum baat karenge ek bahut hi interesting topic ke baare mein – Linear Regression. Yeh Data Science ki duniya ka ek aisa...
- Set & List Comprehension’s in Python Sets A set is an unordered collection Eliminates duplicate entries. Empty set my_set= set() my_set = 1,2,3,4 :- add my_set.add(5) remove /de...
- Learn Python Programming in 2024 Introduction to Python: What is Python?: Python is a high-level, interpreted programming language known for its simplicity and readability....
- Write a Python script to print a dictionary where the keys are numbers between 1 and 15 (both included) and the values are the square of the keys. Sample Dictionary{1: 1, 2: 4, 3: 9, 4...
- Write a Python program to combine two dictionaries by adding values for common keys. Write a Python program to combine two dictionaries by adding values for common keys. d1 = {‘a’: 100, ‘b’: 200, ‘c’:300} d2 = {‘a’: 300, ‘b’:...
- Write a program that prompts the user to input a positive integer. It should then output a message indicating whether the number is a prime number. A prime number is a number that is evenly divisible only by...