DAY 19(CODE INFINITY)
Today as I said we will provide a code which will give you grade by taking marks input of all the subjects and evaluate your total marks percentage and will give grades on basis of it so Let's get started ...
subject1=int(input("Enter marks of subject 1: "))
subject2=int(input("Enter marks of subject 2: "))
subject3=int(input("Enter marks of subject 3: "))
subject4=int(input("Enter marks of subject 4: "))
subject5=int(input("Enter marks of subject 5: "))
total= subject1+subject2+subject3+subject4+subject5
average=total/5
print("Total marks: ",total)
percentage=(total/500)*100
print("Percentage: ",percentage)
if (percentage>=90 and percentage<=100):
print("Grade = Execelent")
elif (percentage>=80 and percentage<=90):
print("Grade = A")
elif (percentage>=70 and percentage<=80):
print("Grade = B")
elif (percentage>=60 and percentage<=70):
print("Grade = C")
elif (percentage>=50 and percentage<=60):
print("Grade = D")
else:
print("Grade = F")
Screenshot of the repel:
![]() |
Link of repel:
Comments