I have been trying to test the argument test scores to see if any tests are below 50. If so it should return fail. If the avg is above 70 and no tests are below 50 then it should return pass.
def course_grader(test_scores):
avg_grade = sum(test_scores) / len(test_scores)
if avg_grade >= 70 and test_scores >= 50:
print("pass")
elif avg_grade < 70 or test_scores < 50:
print("fail")
break
def main():
print(course_grader([100,75,45])) # "fail"
print(course_grader([100,70,85])) # "pass"
print(course_grader([80,60,60])) # "fail"
print(course_grader([80,80,90,30,80])) # "fail"
print(course_grader([70,70,70,70,70])) # "pass"
if __name__ == "__main__":
main()
I also tried using a for loop but it was giving me too many answers.