You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#Write conditional statements to identify the student’s average marks. If any subject’s mark is less than 40, you should print FAILED instead of making average marks
student_1 = [40, 35, 70, 90, 56]
student_2 = [57, 35, 80, 98, 46]
sum1=0
f1=False
sum2=0
f2=False
failed_mark=40
for i in range(len(student_2)):
if student_1[i]>=failed_mark:
sum1+=student_1[i]
else:
f1=True
if student_2[i]>=failed_mark:
sum2+=student_2[i]
else:
f2=True
if f1:print("Student 1 is failed")
else:print(f"Student 1 avarage mark = {sum1/len(student_1)}")
if f2:print("Student 2 is failed")
else:print(f"Student 2 avarage mark = {sum2/len(student_2)}")