Write a program to input marks of a child for all 4 subjects mentioned above and print his/her grade or print fail .
Answers
Answered by
1
Answer:
# using python
marks = []
total_marks_for_each_subject = 100
for i in range(4):
subjectmarks = input("Enter "+str(i+1)+" subject marks")
marks. append(subjectmarks)
percentage = sum(marks)*100/(total_marks_for_each_subject*4)
if percentage>=90:
print("you passed with grade A1")
elif percentage>=80 and percentage<90:
print("you passed with grade A2")
elif percentage>=70 and percentage <80:
print("you passed with grade B1")
elif percentage>=60 and percentage<70:
print("you passed with grade B2")
elif percentage>=50 and percentage<60:
print("you passed with grade C1")
elif percentage>=40 and percentage <50:
print("you passed with grade C2")
else:
print("You Failed")
Similar questions