Write a python program that will take the quiz, mid, lab and final marks from the user and calculate the grade.
Total_marks = quiz+mid+lab+final
Total_marksGradeFrom 90 to 100(inclusive)"Grade: A"From 80 to 89(inclusive)"Grade: B"From 70 to 79(inclusive)"Grade: C"From 60 to 69(inclusive)"Grade: D"From 50 to 59(inclusive)"Grade: F"Less than 0 or more than 100 (exclusive)"Invalid Input"
Sample Input:
Quiz marks = 18
Mid marks = 30
Lab marks = 20
Final marks = 26
Sample Output:
Grade: A
quiz = int(input("Quiz marks = "))
mid = int(input("Mid marks = "))
lab = int(input("Lab marks = "))
final = int(input("Final marks = "))
total_marks = quiz + mid + lab + final
if total_marks <=100 and total_marks>=90:
print("Grade A")
elif total_marks <90 and total_marks>=80:
print("Grade B")
elif total_marks <80 and total_marks>=70:
print("Grade C")
elif total_marks <70 and total_marks>=60:
print("Grade D")
elif total_marks <60 and total_marks>=50:
print("Grade F")
elif total_marks <0 or total_marks>100:
print("Invalid Input")
Comments
Leave a comment