Write python program that accepts marks in 5 subjects and outputs average marks ..
Anyone here python expert tell me the answer please SPAM are not allowed✋✋✋❎❎❎
Answers
Answer:
A=int(input("Enter 1st subject marks"))
B=int(input("Enter 2nd subject marks"))
C=int(input("Enter 3rd subject marks"))
D=int(input("Enter 4th subject marks"))
E=int(input("Enter 5th subject marks"))
Sum=A+B+C+D+E
Avg=Sum/5
print("AVERAGE MARKS=",Avg)
.......
(you can also use float instead of int)
Explanation:
sub1=int(input("Enter marks of the first subject: "))
sub2=int(input("Enter marks of the second subject: "))
sub3=int(input("Enter marks of the third subject: "))
sub4=int(input("Enter marks of the fourth subject: "))
sub5=int(input("Enter marks of the fifth subject: "))
avg=(sub1+sub2+sub3+sub4+sub4)/5
if(avg>=90):
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")