Input The Marks of 5 Subjects and Display the Grade in python

Share on facebook
Share on twitter
Share on pinterest

In this python program, we will display the grade in python. User need to input the grades on 5 subject.

Python program to Input The Marks of 5 Subjects and Display the Grade

sub1=int(input("Enter first subject's marks: "))
sub2=int(input("Enter second subject's marks: "))
sub3=int(input("Enter third subject's marks: "))
sub4=int(input("Enter fourth subject's marks: "))
sub5=int(input("Enter fifth subject's marks: "))
avg=(sub1+sub2+sub3+sub4+sub4)/5
if(avg>=95):
print("Grade: A")
elif(avg>=80&avg<90): print("Grade: B") elif(avg>=70&avg<80): print("Grade: C") elif(avg>=60&avg<70):
print("Grade: D")
else:
print("Grade: F")

Subscribe to our Newsletter

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.

Share this post with your friends

Share on facebook
Share on google
Share on twitter
Share on linkedin

Leave a Reply

Your email address will not be published. Required fields are marked *