5 Program that takes the marks of 5 subjects and display the grades using Python

Program:

m1,m2,m3,m4,m5 = input("Enter 5 Subject Marks").split(' ')



m1 = int(m1)

m2 = int(m2)

m3 = int(m3)

m4 = int(m4)

m5 = int(m5)



sum =  m1 + m2 + m3 + m4 + m5

avg = sum/5.0



if avg >= 90:

    print("A Grade")

elif avg >=70:

    print("B Grade")

elif avg >=50:

    print("C Grade")

elif avg >=30:

    print("D Grade")

else:

    print("Fail")


Output:

Program that takes the marks of 5 subjects and display the grades using Python

Previous
Next Post »